testcontainers / testcontainers/testcontainers-java
Image Name Substitution not applied for DockerComposeContainers
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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