I try to build docker image with your library and think I found a bug.
I have such project structure:
/path/to/project/docker/Dockerfile
/path/to/project/target/app.jar
In my Dockerfile:
(...)
COPY target/app.jar /opt/app/app.jar
(...)
I try to build image with code:
final String baseDirectory = "/path/to/project";
final String dockerfile = baseDirectory + "/docker/Dockerfile";
dockerClient.buildImageCmd()
.withBaseDirectory(new File(baseDirectory))
.withDockerfile(new File(dockerfile))
.exec()
.awaitImageId();
I get error: Could not build image: lstat target/app.jar: no such file or directory
I think there is bug in class Dockerfile.
In method processAddStatement() is line
src = new File(dockerFolder, resource);
and dockerFolder is parent directory of Dockerfile. IMO it is incorrect, it should be
src = new File(baseDirectory, resource);
where baseDirectory is directory passed to method withBaseDirectory() of BuildImageCmd.
From commandline build works with command
docker build -f docker/Dockerfile .
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
Activity
KostyaSha commented on Apr 18, 2016
please provide PR
Sent from my iPad
Fix issue #551
Fix issue #551
Merge pull request #578 from docker-java/issue-551
marcuslinke commented on May 12, 2016
Closed via #578
Fix issue docker-java#551
Merge pull request docker-java#578 from docker-java/issue-551