spring-guides / gs-spring-boot-docker

Spring Boot with Docker :: Learn how to create a Docker container from a Spring Boot application with Maven or Gradle

Home Page:https://spring.io/guides/gs/spring-boot-docker/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The new Dockerfile has some problem?

nanquanyuhao opened this issue · comments

Today I has update my gs-spring-boot-docker from yours, the file complete/Dockerfile has some changes and I encounter a problem.

When I build it on Jenkins, error like this...

[INFO] Step 1/7 : FROM openjdk:8-jdk-alpine

[INFO] Pulling from library/openjdk

[INFO] Digest: sha256:a2d7b02891b158d01523e26ad069d40d5eb2c14d6943cf4df969b097acaa77d3
[INFO] Status: Image is up to date for openjdk:8-jdk-alpine
[INFO]  ---> 54ae553cb104
[INFO] Step 2/7 : VOLUME /tmp
[INFO]  ---> Using cache
[INFO]  ---> 3353714d3176
[INFO] Step 3/7 : ARG DEPENDENCY=target/dependency
[INFO]  ---> Using cache
[INFO]  ---> 014daa4bcc62
[INFO] Step 4/7 : COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
[ERROR] COPY failed: stat /home/techgroup/docker/tmp/docker-builder059966854/target/dependency/BOOT-INF/lib: no such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.234 s
[INFO] Finished at: 2018-10-17T16:19:13+08:00

[INFO] Final Memory: 54M/2538M

Like you see.
I don't know why the ${DEPENDENCY} is /home/techgroup/docker/tmp/docker-builder059966854/target/dependency instead of target/dependency?
And this is a Spring-boot project, why the start script is ENTRYPOINT ["java","-cp","app:app/lib/*","hello.Application"] instead of ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
I am puzzled. Can you give me an answer? Thanks...

Sorry, I think I have find the reason because I annotated unpack...