[compatible issue]buildkit COPY command doesn't match to docker's
Open
Nobody has claimed this yet.
area/feature-parity
- Dominant language
- Go
- Stars
- 10.3k
- Forks
- 1.5k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 48
Description
- I have a directory only has one Dockerfile, its content is:
#cat Dockerfile
FROM alpine
COPY folder/a/* folder/b/* /home/admin/
- using docker build command, it will fail
#DOCKER_BUILDKIT=0 docker build -t test .
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM alpine
---> e66264b98777
Step 2/2 : COPY folder/a/* folder/b/* /home/admin/
COPY failed: no source files were specified
- after I make folder/a and its sub directory, it build success without specified folder/b
#mkdir -p folder/a/sub_a
#DOCKER_BUILDKIT=0 docker build -t test .
Sending build context to Docker daemon 3.584kB
Step 1/2 : FROM alpine
---> e66264b98777
Step 2/2 : COPY folder/a/* folder/b/* /home/admin/
---> 0c7538017880
Successfully built 0c7538017880
Successfully tagged test:latest
- but in same directory, buildkit fails to build
#DOCKER_BUILDKIT=1 docker build -t test .
[+] Building 0.1s (6/6) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 89B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 90B 0.0s
=> CACHED [1/2] FROM docker.io/library/alpine 0.0s
=> ERROR [2/2] COPY folder/a/* folder/b/* /home/admin/ 0.1s
------
> [2/2] COPY folder/a/* folder/b/* /home/admin/:
------
lstat /var/lib/docker/tmp/buildkit-mount1810022841/folder/b: no such file or directory
docker version 20.10.16, with builtin buildkit
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown Dockerfile and compare DOCKER_BUILDKIT=0 and DOCKER_BUILDKIT=1 using the same build context. Trace BuildKit's COPY wildcard handling for a missing folder/b path. Done means the BuildKit result matches Docker's behavior for this context, with regression coverage for the command shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100