testcontainers / testcontainers/testcontainers-java
Can't define a specific build stage for a ImageFromDockerfile
Open
Nobody has claimed this yet.
resolution/acknowledged
type/feature
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Hello,
I'm using a container build from a Dockerfile with a multi-stage builds in my test:
public class SozuContainer <SELF extends SozuContainer<SELF>> extends GenericContainer<SELF> {
public SozuContainer() {
super(
new ImageFromDockerfile()
.withFileFromClasspath("Dockerfile", "sozu/Dockerfile")
);
....
}
And when I run my Junit test, the image build is the first stage of my multi-stage builds: builder.
Do you have a way to declare which target stage I want for my ImageFromDockerfile ?
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 the ImageFromDockerfile entry point and the Dockerfile multi-stage build shown in the issue. Check how the JUnit test currently selects the built stage, then add coverage showing that a requested target stage is used and the default behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100