Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildKit can't COPY paths with non-ASCII characters #3927

Closed
felixkrull-neuland opened this issue Jun 2, 2023 · 1 comment · Fixed by #3946
Closed

BuildKit can't COPY paths with non-ASCII characters #3927

felixkrull-neuland opened this issue Jun 2, 2023 · 1 comment · Fixed by #3946
Labels
area/feature-parity Feature parity with classic builder kind/bug

Comments

@felixkrull-neuland
Copy link

When trying to build a Dockerfile using BuildKit that contains paths with non-ASCII characters in COPY commands, I get the following error message

ERROR: failed to solve: Internal: rpc error: code = Internal desc = rpc error: code = Internal desc = header key "followpaths" contains value with non-printable ASCII characters

I was able to reproduce this on Ubuntu 22.04 using Docker Engine 24.0.2 installed from the docker.com APT repository:

vagrant@ubuntu-22-04:~/repro-non-ascii$ ls -lh
total 8.0K
-rw-rw-r-- 1 vagrant vagrant 43 Jun  2 10:42 Dockerfile
-rw-rw-r-- 1 vagrant vagrant  5 Jun  2 10:42 test-äöü.txt
vagrant@ubuntu-22-04:~/repro-non-ascii$ cat test-äöü.txt 
test
vagrant@ubuntu-22-04:~/repro-non-ascii$ cat Dockerfile 
FROM alpine:latest
COPY test-äöü.txt /

Building with BuildKit fails:

vagrant@ubuntu-22-04:~/repro-non-ascii$ sudo docker build .
[+] Building 1.1s (5/6)                                                         
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 80B                                        0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/alpine:latest           1.1s
 => ERROR [internal] load build context                                    0.0s
 => => transferring context:                                               0.0s
 => CACHED [1/2] FROM docker.io/library/alpine:latest@sha256:02bb6f428431  0.0s
------
 > [internal] load build context:
------
ERROR: failed to solve: Internal: rpc error: code = Internal desc = rpc error: code = Internal desc = header key "followpaths" contains value with non-printable ASCII characters

Building without Buildkit works:

vagrant@ubuntu-22-04:~/repro-non-ascii$ sudo DOCKER_BUILDKIT=0 docker build .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.

Sending build context to Docker daemon  4.096kB
Step 1/2 : FROM alpine:latest
latest: Pulling from library/alpine
8a49fdb3b6a5: Already exists 
Digest: sha256:02bb6f428431fbc2809c5d1b41eab5a68350194fb508869a33cb1af4444c9b11
Status: Downloaded newer image for alpine:latest
 ---> 5e2b554c1c45
Step 2/2 : COPY test-äöü.txt /
 ---> 25b30012519d
Successfully built 25b30012519d

I sincerely hope this is a regression and not intended behaviour. This would be a severe limitation.

@jedevc
Copy link
Member

jedevc commented Jun 9, 2023

Hm, this definitely needs further investigation. I think we should definitely be supporting this, but I couldn't find a test for this kind of behavior 👀

I worked on a quick test for this: f9f2a00, I'll try and take a bit of a deeper dive into it when I have some time, though if anyone else is interested, feel free to pick it up 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/feature-parity Feature parity with classic builder kind/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants