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

WCOW: COPY --from failing with failed to walk error on Windows 11 #5193

Open
danielGithinji opened this issue Jul 26, 2024 · 3 comments · May be fixed by #5289
Open

WCOW: COPY --from failing with failed to walk error on Windows 11 #5193

danielGithinji opened this issue Jul 26, 2024 · 3 comments · May be fixed by #5289

Comments

@danielGithinji
Copy link

danielGithinji commented Jul 26, 2024

Docker desktop version 4.32.0
Buildkit version 0.15.1

Operating system: Windows 11

I have run the following dockerfile with both docker desktop and buildkit and below are the results:

FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS build
RUN echo helloworld > out

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
COPY --from=build /out /out

Docker command results below are successful in building an image

docker build --no-cache -t my-nanoserver-app .

Sending build context to Docker daemon  242.2MB
Step 1/9 : ARG a1="nanoserver:ltsc2022"
Step 2/9 : ARG a2
Step 3/9 : FROM mcr.microsoft.com/windows/$a1 AS build
 ---> f0ca29645006
Step 4/9 : ARG a2="nanoserver-foo"
 ---> Running in 5ff4930ad31b
 ---> Removed intermediate container 5ff4930ad31b
 ---> 9776575fecc4
Step 5/9 : ARG a3
 ---> Running in 1845c3aab27d
 ---> Removed intermediate container 1845c3aab27d
 ---> d9437ada429c
Step 6/9 : SHELL ["cmd", "/S", "/C"]
 ---> Running in 05828541ddf6
 ---> Removed intermediate container 05828541ddf6
 ---> aac8330748be
Step 7/9 : RUN echo bar-%a2% > C:\\out
 ---> Running in 7c3082aad152
 ---> Removed intermediate container 7c3082aad152
 ---> 016152b960bd
Step 8/9 : FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
 ---> f0ca29645006
Step 9/9 : COPY --from=build C:\\out C:\\out
 ---> 6ea0ec197aa1
Successfully built 6ea0ec197aa1
Successfully tagged my-nanoserver-app:latest

Buildkit command results:

 buildctl build `
>> --frontend=dockerfile.v0 `
>> --local context=. \ `
>> --local dockerfile=. `
>> --output type=image,name=my-nanoserver-app:v1,push=false `
>> --progress plain `
>> --no-cache

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 333B 0.0s done
#1 DONE 0.1s

#2 [internal] load metadata for mcr.microsoft.com/windows/nanoserver:ltsc2022
#2 DONE 1.4s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [build 1/2] FROM mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:cc9f6a1334190c1f18a905f56d285132e562a9a1ce18ff9476cfaf95194aa0b7
#4 resolve mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:cc9f6a1334190c1f18a905f56d285132e562a9a1ce18ff9476cfaf95194aa0b7 0.0s done
#4 CACHED

#5 [build 2/2] RUN echo bar-%a2% > C:\out
#5 DONE 1.2s

#6 [stage-1 2/2] COPY --from=build C:\out C:\out
#6 ERROR: failed to calculate checksum of ref 176tvlj7tnwnyvkujk5ps5q0v::vwg2hzqc62xfuk6vw34x6ax43: failed to walk C:\Users\DGITHI~1\AppData\Local\Temp\buildkit-mount3999950507\WcSandboxState: open C:\Users\DGITHI~1\AppData\Local\Temp\buildkit-mount3999950507\WcSandboxState: Access is denied.
------
 > [stage-1 2/2] COPY --from=build C:\out C:\out:
------
Dockerfile:11
--------------------
   9 |
  10 |     FROM mcr.microsoft.com/windows/nanoserver:ltsc2022
  11 | >>> COPY --from=build C:\\out C:\\out
--------------------
error: failed to solve: failed to compute cache key: failed to calculate checksum of ref 176tvlj7tnwnyvkujk5ps5q0v::vwg2hzqc62xfuk6vw34x6ax43: failed to walk C:\Users\username\AppData\Local\Temp\buildkit-mount3999950507\WcSandboxState: open C:\Users\username\AppData\Local\Temp\buildkit-mount3999950507\WcSandboxState: Access is denied.

The buildkit command result fails above fails partly because of an "Access is denied" error at the given directory. I'm running both commands as administrator in the Windows terminal.

After running the buildkit command on Windows server 2022 I get a successful response as seen below:

#8 [stage-1 2/2] COPY --from=build /out /out
#8 DONE 0.4s

#9 exporting to image
#9 exporting layers
#9 exporting layers 0.5s done
#9 exporting manifest sha256:058f1fb53f5d61ac1265f5934799de7720161ab6fc6bb5327c9da52436295a92 0.0s done
#9 exporting config sha256:640266655f00287d4909cb67866c68e0b2a3bb077a51272ce89e455ec3cf4e3f 0.0s done
#9 naming to comm-checkin/hello-buildkit 0.0s done
#9 DONE 0.6s

@danielGithinji danielGithinji changed the title WCOW: "COPY --from" failing in buildkit when using Windows container images but works with docker WCOW: "COPY --from" failing with failed to walk error in buildkit when using Windows container images but works with docker Jul 27, 2024
@danielGithinji danielGithinji changed the title WCOW: "COPY --from" failing with failed to walk error in buildkit when using Windows container images but works with docker WCOW: COPY --from failing with failed to walk error in buildkit when using Windows container images but works with docker Jul 27, 2024
@profnandaa profnandaa self-assigned this Aug 7, 2024
@profnandaa
Copy link
Collaborator

@danielGithinji -- can you run the same on WS2022 please?

@profnandaa
Copy link
Collaborator

cross-linking #4994

@danielGithinji danielGithinji changed the title WCOW: COPY --from failing with failed to walk error in buildkit when using Windows container images but works with docker WCOW: COPY --from failing with failed to walk error on Windows 11 Aug 12, 2024
@danielGithinji
Copy link
Author

Yes its successful on WS2022

billywr pushed a commit to billywr/buildkit that referenced this issue Sep 2, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 3, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 3, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 3, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 3, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 3, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 4, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 5, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 5, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 5, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 5, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 5, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 9, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 23, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 23, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 24, 2024
billywr pushed a commit to billywr/buildkit that referenced this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants