testcontainers / testcontainers/testcontainers-java
Usage of `ImageFromDocker` not intuitive if `withDockerfile` is used
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
When defining a GenericContainer using ImageFromDockerfile like this, the resulting build context will have a very unexpected structure (flattening all files in the build context root?), and building the image will fail if the user is not aware of it.
private final GenericContainer<?> container= new GenericContainer<>(
new ImageFromDockerfile()
.withDockerfile(Paths.get("src/main/docker/Dockerfile.jvm"))
.withFileFromPath("./target", Paths.get("target/"))
);
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 withDockerfile and withFileFromPath calls shown in the example. Reproduce the build using src/main/docker/Dockerfile.jvm and target/ to inspect the generated context. Done means the context structure is intuitive and the example builds successfully without requiring undocumented assumptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100