Problem
Unless I am missing something, there does not appear to be a way to target a specific image in a multi-stage build. The java library appears to support this with withTarget https://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java#L242
Solution
Add a method on ImageFromDockerfileBuilder .WithTarget that would target a particular stage.
Benefit
This would allow more flexibility in the types and structures of Dockerfiles that are supported well.
Alternatives
One alternative is having two Dockerfiles, but that can defeat the purpose of testing and shipping the exact same things.
Would you like to help contributing this enhancement?
No
Problem
Unless I am missing something, there does not appear to be a way to target a specific image in a multi-stage build. The java library appears to support this with
withTargethttps://github.com/testcontainers/testcontainers-java/blob/main/core/src/main/java/org/testcontainers/images/builder/ImageFromDockerfile.java#L242Solution
Add a method on
ImageFromDockerfileBuilder.WithTargetthat would target a particular stage.Benefit
This would allow more flexibility in the types and structures of Dockerfiles that are supported well.
Alternatives
One alternative is having two Dockerfiles, but that can defeat the purpose of testing and shipping the exact same things.
Would you like to help contributing this enhancement?
No