Skip to content

TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX should first try to pull images using docker rather than https #991

@ashmeet-kandhari

Description

@ashmeet-kandhari

Expected Behaviour
Whenever testcontainers try to pull images it should pull using docker pull <image> rather than using http(s).
Because incase of private repositories like AWS ECR access is configured via IAM roles and for http request it requires explicit setting of creds

Actual Behaviour
Testcontainers use https to pull the images

Testcontainer Logs
console.log

Error:     2025-04-17T10:25:57.625Z testcontainers [ERROR] Failed to pull image "<AWS_ACCOUNT_ID>.dkr.ecr.eu-west-1.amazonaws.com/testcontainers/docker.io/testcontainers/ryuk:0.11.0": Error: (HTTP code 500) server error - Head "https://<AWS_ACCOUNT_ID>.dkr.ecr.eu-west-1.amazonaws.com/v2/testcontainers/docker.io/testcontainers/ryuk/manifests/0.11.0": no basic auth credentials

Steps to Reproduce

  1. Run it in a server where AWS private repository is set via TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX
  2. Try to run the testcontainers test

Environment Information

  • Operating System: ubuntu
  • Docker Compose Version: 2.32.4
  • Node version: 22
  • Testcontainers version: 10.24.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageInvestigation required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions