[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的目錄便可