testcontainers / testcontainers/testcontainers-java

Image Name Substitution not applied for DockerComposeContainers

Open
#4,605 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/docker-compose
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

I have a set of tests which create a DockerComposeContainer on startup. I ran into the below error when the tests run on a CI server:

com.github.dockerjava.api.exception.InternalServerErrorException: Status 500: {"message":"toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"}

First, I tried setting a hub.image.name.prefix to point to my company's local registry, but continued to run into the error. I next tried creating a custom ImageNameSubstitutor to redirect images to my company's local registry, but that did not seem to help either. I then tried changing all image names in my docker-compose file to point at the local registry, and that seemed to resolve my problems.

I could be wrong, but I suspect this is because the image substitution mechanism is called from RemoteDockerImage, which is not used when parsing docker-compose files. My build logs seem to indicate that the ryuk and socat images are correctly being pulled from the local registry, but not the images referenced in the compose file.

Is this intended behavior? I don't see any references to docker-compose on the documentation page about image substitution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DockerComposeContainer image handling and compare it with the ImageNameSubstitutor path used by RemoteDockerImage. Reproduce the CI pull-rate-limit case using a custom registry and a compose file, then verify that compose-referenced images are redirected consistently and that the image-substitution documentation reflects the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, java
Domain
devops, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.