Skip to content

[Enhancement]: ImageFromDockerfileBuilder WithTarget support #1475

Description

@TylerReid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions