testcontainers-node icon indicating copy to clipboard operation
testcontainers-node copied to clipboard

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

Open ashmeet-kandhari opened this issue 9 months ago • 0 comments

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

ashmeet-kandhari avatar Apr 17 '25 11:04 ashmeet-kandhari