如果我的项目结构是这样的:
├── compose
│ ├── local
│ │ └── django
│ │ ├── Dockerfile
│ │ ├── celery
│ │ │ ├── beat
│ │ │ │ └── start.sh
│ │ │ └── worker
│ │ │ └── start.sh
│ │ └── start.sh
│ └── production
│ ├── caddy
│ │ ├── Caddyfile
│ │ └── Dockerfile.caddy
│ ├── django
│ │ ├── Dockerfile.django
我是来自root,$ heroku container:push --recursive
但是,如果COPY失败,构建将失败:
Sending build context to Docker daemon 3.072kB
Step 1/2 : FROM abiosoft/caddy:0.10.6
---> d8ff070e1cee
Step 2/2 : COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile
COPY failed: stat /var/lib/docker/tmp/docker-builder022230374/compose/production/caddy/Caddyfile: no such file or directory
▸ Error: docker build exited with 1
实际的Dockerfile:
FROM abiosoft/caddy:0.10.6
COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile
我已阅读此类似的stackoverflow帖子:Dockerfile COPY instruction failing?
根据最佳答案,我确实相信我在构建时明确引用了该文件 我猜不会。我错过了什么?