-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for image name substitution (prefixing of Docker Hub images) #466
Comments
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
Yes — of course, we can add this functionality. But why do we need so many changes? Couldn't we add this functionality with just a few lines in |
I think we could manage without the changes to If you disagree here, I am certainly willing to simplify and move the functionality into |
I'm just thinking about a simpler implementation. It looks so much code for such a simple task. Maybe it's better to extend the builder with a private method that append the prefix. |
I just think the code is better structured and extensible the way it currently is. Besides, a significant portion of the added LoC is test data and documentation. To bring this to a fruitful end: I will get rid of the abstraction and add the core logic directly in |
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
Done :). |
… function: Image Name Substitution'
… function: Image Name Substitution'
… function: Image Name Substitution'
…tcontainersBuilder' {Add DockerHubImagePrefix.}
…HubImagePrefixTest' {User MemberData for unit tests (DockerHubImagePrefixTest 🠒 DockerImageNameSubstitutionTest).}
…HubImagePrefixTest' {User MemberData for unit tests (DockerHubImagePrefixTest 🠒 DockerImageNameSubstitutionTest).}
Is your feature request related to a problem? Please describe.
To handle Docker Hub rate limiting, I want to use a pull through cache to proxy all images pulled from Docker Hub.
Currently, to make Testcontainers use this pull through cache, developers would have to modify the container setup for all images hosted on Docker Hub and prepend the hostname of the pull through cache to the image name. This is tiresome and error prone.
Describe the solution you'd like
I would like to centrally configure a prefix that is prepended to all image names hosted on Docker Hub.
Example: with a configured prefix "my.proxy.com" the image "docker:latest" becomes "my.proxy.com/docker:latest" and the image "my.azurecr.io/docker:latest" would be left as is.
Describe alternatives you've considered
Additional context
Testcontainers for Java already has a feature called Image Name Substitution (https://www.testcontainers.org/features/image_name_substitution/).
I already implemented support for a simple prefixing substitution strategy. If you agree with the premise of this issue, I can open a merge request.
The text was updated successfully, but these errors were encountered: