testcontainers-java
testcontainers-java copied to clipboard
`ImageFromDockerfile` not working when `withFileFromFile` and `withDockerfile` are used at the same time
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
Since this unexpected behavior re-surfaces time and time again, I think the issue here is, that withDockerfile() generally does not honor the user specified context. I am not sure if this originates in our upstream integration with docker-java, I did not find the issue in our code on a first glance.