testcontainers / testcontainers/testcontainers-java

`ImageFromDockerfile` not working when `withFileFromFile` and `withDockerfile` are used at the same time

Open
#4,693 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Issue

This works as expected

new ImageFromDockerfile(imageName, true)
    .withFileFromFile("Dockerfile", new File("dev/keycloak/Dockerfile"))
    .withFileFromFile("dev/keycloak/sbt-project", new File("dev/keycloak/sbt-project"))

while this fails to create image and deadlocks on PipedInputStream#awaitSpace()

new ImageFromDockerfile(imageName, true)
    .withDockerfile(new File("dev/keycloak/Dockerfile").toPath)
    .withFileFromFile("dev/keycloak/sbt-project", new File("dev/keycloak/sbt-project"))
Expected result

At least some kind of warning or exception

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 at ImageFromDockerfile and trace how withDockerfile and withFileFromFile add their inputs, focusing on the PipedInputStream#awaitSpace() deadlock. Reproduce the two fluent-call combinations from the issue and make the conflicting usage produce a warning or exception instead of hanging.

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.