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

Closed
danielnilsson9 opened this issue Dec 17, 2024 · 4 comments · Fixed by #5708
Closed

WCOW: RUN with bind/cache mounts #5603

danielnilsson9 opened this issue Dec 17, 2024 · 4 comments · Fixed by #5708
Labels
Milestone

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.

@profnandaa
Copy link
Collaborator

@danielnilsson9 -- I've got bind and cache mounts working and wanted your preliminary review on this as I complete out the rest of the stuff on the check-list -> #5708

@danielnilsson9
Copy link
Author

Awesome! Greatly appreciated! I'm not sure I can help with a review as I'm not at all familiar with this codebase but I can put it to the test on our build servers as I intended for running C++ compilation in build containers on Windows.

@profnandaa
Copy link
Collaborator

Sure, that will help, please do. Thanks!

profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 7, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603
Addresses part of moby#5678

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 10, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603
Addresses part of moby#5678

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 11, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603
Addresses part of moby#5678

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 11, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603
Addresses part of moby#5678

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 12, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 12, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 14, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentatio
- [ ] add note and plan on the missing feature(s)
	i.e. secret mounts (that need tmpfs)
- [ ] spec out / second attempt for SSH mount

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 14, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [ ] add client integration tests
- [ ] add documentation

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 14, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 20, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 20, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 20, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 20, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
profnandaa added a commit to profnandaa/buildkit that referenced this issue Feb 20, 2025
Currently, mounts are not supported for WCOW builds,
see moby#5678. This commit introduces support for
bind and cache mounts. The remaining two require
a little more work and consultation with the platform
teams for enlightment.

WIP Checklist:

- [x] Support for bind mounts
- [x] Support for cache mounts
- [x] add frontend/dockerfile integration tests
- [x] add client integration tests (not all, `llb.AddMount` not
  complete)

Fixes moby#5603

Signed-off-by: Anthony Nandaa <[email protected]>
@thompson-shaun thompson-shaun added this to the v0.21.0 milestone Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants