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

ADD failed

ratelgogo opened this issue · comments

[INFO] Step 4/5 : ADD ${JAR_FILE} app.jar
[ERROR] ADD failed: stat /var/lib/docker/tmp/docker-builder121430157/target/gs-spring-boot-docker-0.1.0.jar: no such file or director

docker info

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 6
Server Version: 17.09.0-ce
Storage Driver: overlay
 Backing Filesystem: extfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-693.2.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.702GiB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

any suggestion?

./mvnw install dockerfile:build

just works fine

mvn install dockerfile:build

add failed

Please post the console output. It's possible your installed version of maven is incorrect.

@gregturn

mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: /usr/local/maven/apache-maven-3.5.2
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_152/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.2.2.el7.x86_64", arch: "amd64", family: "unix"

it's weird. the problem is not occurred after build success. even if i delete the docker image and redownload the source code.