Bruce_Zhang0828
搬砖的孟达
采纳率0%
2018-11-17 01:07 阅读 5.7k

maven打包项目到docker的时候:ADD failed: stat xxx: no such file or directory

Step 3/4 : ADD springboot-0.0.1.jar app.jar

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.710 s
[INFO] Finished at: 2018-11-17T09:01:01+08:00
[INFO] Final Memory: 32M/218M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project springboot: Exception caught: ADD failed: stat /var/lib/docker/tmp/docker-builder955781350/springboot-0.0.1.jar: no such file or directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

这是dockerfile的内容:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ADD springboot-0.0.1.jar app.jar
ENTRYPOINT ["java","Djava.security.egd=file:/dev/.urandom","-jar","/app.jar"]

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • qq_26897321 原来不是错觉 2019-04-27 22:13

    先打包,比如打包在target,dockerfile文件要跟jar包在同一目录下面。

    点赞 评论 复制链接分享

相关推荐