Open Toraja opened 1 year ago
<project root>/tools
buildx
docker compose
compose.yml
. ├── ctx │ └── Dockerfile └── vol ├── animals │ ├── bear │ ├── cat │ └── dog └── fruits.txt
# syntax=docker/dockerfile:1 FROM alpine:latest RUN mkdir -p /wk/vol/ \ && touch /wk/vol/quack COPY --from=x . /wk/vol/
docker buildx build --build-context x=vol/ --force-rm -t runmount ctx/
COPY instruction does not overwrite existing files
COPY
/ # tree /wk/vol/ /wk/vol/ ├── animals │ ├── bear │ ├── cat │ └── dog ├── fruits.txt └── quack
As described in ADR 0006, rewrite required tools in other language and release them instead of using external build context.
Summary
<project root>/tools
directorybuildx
to access the directory during building base imagedocker compose
does not supportbuildx
, so you need to separate build part fromcompose.yml
Research
Host dir/file
Dockerfile
Command
Result
COPY
instruction does not overwrite existing files