moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
8.04k stars 1.13k forks source link

Windows docker container buildctl does not allow mounting secrets. It fails mounting to linux tmpfs location #5273

Open lorentz-1 opened 2 weeks ago

lorentz-1 commented 2 weeks ago

I am using version 1.7.18 of containerd and 0.14.0 of buildkit. When creating a docker image from docker file using the following command

buildctl.exe build \ --frontend dockerfile.v0 \ --local context=. \ --local dockerfile=. \ --output type=image,\"name=test_image:1.0\" \ --secret id=creds-usr,env=CREDS_USR \ --secret id=creds-psw,env=CREDS_PSW \ ${buildArgs.join(' ')}


I have the following dockerfile

FROM mcr.microsoft.com/windows/servercore RUN --mount=type=secret,id=creds-usr,required=True,target=C:\secrets\creds-usr \ --mount=type=secret,id=creds-psw,required=True,target=C:\secrets\creds-psw \ //Followed by other commands I use to perform network operations.


The build output fails at following error unable to setup secret mount: invalid windows mount type: 'tmpfs'

Has any one has success is mounting secrets using windows containers?

Originally posted by @lorentz-1 in https://github.com/moby/buildkit/discussions/5272

lilayam commented 1 week ago

I encountered this bug. Was hoping someone would fix it or propose some ways to fix this

profnandaa commented 1 week ago

Currently RUN --mount is not supported on Windows. Current mount types are Linux specific, like tmpfs. We are yet to look into the design of this feature but it's good to see that there's demand for it, so this will help in our prioritization.

However, currently, the aim is to have full parity with the classic builder (current docker build for Windows) first.