fix: Do not pre pull Dockerfile build stages that do not correspond to base images #979
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This pull request excludes Dockerfile build stages that do not correspond to base images.
Why is it important?
This pull request addresses an issue related to building Docker images that have dependencies on base images from private registries. Currently, Testcontainers encounters an issue when attempting to pull actual images. Testcontainers does not distinguish between base images and intermediate build stages. Intermediate build stages cannot be pulled; Testcontainers must ignore these stages. E.g. the second line of the following Dockerfile:
Related issues
Dockerfile
with intermediate layer (regression works with3.3.0
) #972ARG
s) during Docker image build #980Follow-ups
Testcontainers for .NET cannot resolve variables (
ARG
s) during the Docker image build process. Currently, Testcontainers ignores all base images that utilize variables. To pull these base images in advance too, Testcontainers needs to have the capability to resolve the default values or build arguments of variables.