testcontainers / testcontainers/testcontainers-java

Can't define a specific build stage for a ImageFromDockerfile

Open
#886 4 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.