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: RUN with bind/cache mounts #5603

Open
danielnilsson9 opened this issue Dec 17, 2024 · 1 comment
Open

WCOW: RUN with bind/cache mounts #5603

danielnilsson9 opened this issue Dec 17, 2024 · 1 comment
Labels

Comments

@danielnilsson9
Copy link

I have been doing some testing with windows container builds recently.

I have been trying to figure out it cache/bind mounts are supposed to work or not.
I have found this issue: #4837 Maybe the underlaying cause is the same even though the error message is different?

Environment
Windows Server 2022
Builkit 0.18.1
Containerd 1.7.24

Dockerfile

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

USER ContainerAdministrator
WORKDIR C:/BUILD/
RUN --mount=type=cache,target=C:/BUILD/ echo "Hello" >> hello.txt

Output

buildx build --progress=plain .
#0 building with "windows" instance using remote driver

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

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

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

#4 [stage-0 1/3] FROM mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:eb59dfa1056e41b65cb12b679280e29f10d64e2b569b877710e227a77fef223f
#4 resolve mcr.microsoft.com/windows/nanoserver:ltsc2022@sha256:eb59dfa1056e41b65cb12b679280e29f10d64e2b569b877710e227a77fef223f 0.0s done
#4 DONE 0.0s

#5 [stage-0 2/3] WORKDIR C:/TEMP/
#5 CACHED

#6 [stage-0 3/3] RUN --mount=type=cache,target=C:/TEMP/ echo "Hello" >> hello.txt
#6 ERROR: process "cmd /S /C echo \"Hello\" >> hello.txt" did not complete successfully: failed to create shim task: invalid OCI spec - Type 'windows-layer' not supported: unknown
------
 > [stage-0 3/3] RUN --mount=type=cache,target=C:/TEMP/ echo "Hello" >> hello.txt:
------
WARNING: No output specified with remote driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:7
--------------------
   5 |     WORKDIR C:/TEMP/
   6 |
   7 | >>> RUN --mount=type=cache,target=C:/TEMP/ echo "Hello" >> hello.txt
--------------------
ERROR: failed to solve: process "cmd /S /C echo \"Hello\" >> hello.txt" did not complete successfully: failed to create shim task: invalid OCI spec - Type 'windows-layer' not supported: unknown

Is this the expected result or have I possibly done something wrong?

@profnandaa
Copy link
Collaborator

You are right, they are related. I'm currently investigating how to support this, I will update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants