[webapp@app02 ~/motor]$docker build -t 130.51.23.250:8088/motor/path:1.1 -f /app/webapp/motor/Dockerfile_path /app/webapp/motor
ERRO[0238] Can't add file /app/webapp/motor/logs/pass-repay-task/pass-repay-task.log to tar: archive/tar: write too long
Sending build context to Docker daemon 4.427 GB
Step 1/14 : FROM app03:5000/jdk:1.8.0
$ docker build .
Sending build context to Docker daemon 6.51 MB
...
说明:构建会在Docker后台守护进程(daemon)中执行,而不是CLI中。构建前,构建进程会将所有内容(递归)发送到守护进程。大多状况下,应该将一个空目录做为构建上下文环境,并将Dockerfile文件放在该目录下。
https://www.cnblogs.com/weifeng1463/p/10214972.html
若是要copy的,不能放在空目录。
Step 3/14 : COPY /app/webapp/motor/path-service /opt/path-service
lstat app/webapp/motor/path-service: no such file or directory
不能绝对路径
Step 3/14 : COPY ../path-service /opt/path-service
Forbidden path outside the build context: ../path-service ()
不能上级目录
[webapp@app02 ~/motor]$vi .dockerignore
logs
pass-check
path-repay-task
- 快不少。
- .dockerignore直接放在Dockerfile的目录便可