-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pre-pull images required for Docker Compose image builds - including authenticated pulls #2201
Conversation
So that ImageFromDockerfile and Docker Compose can use images from authenticated registries when building temporary images Fixes #1799
@@ -2,5 +2,3 @@ redis: | |||
image: redis | |||
mysql: | |||
image: mysql | |||
custom: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please clarify why it was removed? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I think I was trying to make sure the tests only tested one thing (we have other test cases and other example compose files that cover the build scenario).
Still, I now think I'll restore it to how it was, to give us better coverage for v1 compose files.
This was released in https://github.com/testcontainers/testcontainers-java/releases/tag/1.14.0 🎉 |
…tainers#2201) * Pre-pull images required for Dockerfile/Compose image builds So that ImageFromDockerfile and Docker Compose can use images from authenticated registries when building temporary images Fixes testcontainers#1799 * Restore wider test scope
So that ImageFromDockerfile and Docker Compose can use images from authenticated registries when building temporary images.
This PR again involves very light parsing; this time adding just enough parsing of Dockerfiles to ensure that images are pre-pulled, and also to discover such Dockerfiles when they're part of a compose build.
This completes our coverage for authenticated pulls - all of the following should now work:
GenericContainer(someAuthenticatedImage)
ImageFromDockerfile
that includes one/moreFROM someAuthenticatedImage
lines. EDIT: post release, I found a bug with this which will be fixed shortlydocker-compose.yml
files that point to an image viaimage: someAuthenticatedImage
docker-compose.yml
files that includebuild: someDockerfile
where the dockerfile includes one/moreFROM someAuthenticatedImage
linesI think the parsing is simple enough, and solid enough, that it should work in all cases. However, it should also do no harm if there is ever an exotic new way to identify docker image names in Dockerfiles/compose files.
Fixes #1799