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

devcontainer build fails with invalid windows mount type: 'bind' #449

Closed
samopolacek opened this issue Mar 15, 2023 · 4 comments
Closed

Comments

@samopolacek
Copy link

I am struggling to build a simple Windows container. devcontainer fails with the following error message:

> devcontainer.cmd build .
(node:13512) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
[2023-03-15T07:34:38.873Z] @devcontainers/cli 0.32.0. Node.js v16.14.2. win32 10.0.19044 x64.
[2023-03-15T07:34:39.789Z] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\SAMUEL~1.POL\AppData\Local\Temp\devcontainercli\container-features\0.32.0-1678865679652\Dockerfile-with-features -t vsc-software-31eb9ee92803919de749f062f644c234 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label c:\dev\XPS\Software\.devcontainer
[2023-03-15T07:34:40.265Z] 2023/03/15 08:34:40 http2: server: error reading preface from client //./pipe/docker_engine: file has already been closed

[2023-03-15T07:34:40.979Z] #1 [internal] load .dockerignore
#1 transferring context:

[2023-03-15T07:34:41.009Z] #1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile-with-features
#2 transferring dockerfile: 246B 0.0s done
#2 DONE 0.0s

[2023-03-15T07:34:41.010Z] ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to mount in-place: {bind C:\ProgramData\Docker\windowsfilter\m2ojs66ypkp47r1ye6evbmvbb [rbind ro]}: invalid windows mount type: 'bind'

[2023-03-15T07:34:41.059Z] Exit code 1
Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\SAMUEL~1.POL\AppData\Local\Temp\devcontainercli\container-features\0.32.0-1678865679652\Dockerfile-with-features -t vsc-software-31eb9ee92803919de749f062f644c234 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label c:\dev\XPS\Software\.devcontainer
    at pie (c:\Users\samuel.polacek\.vscode\extensions\ms-vscode-remote.remote-containers-0.284.0\dist\spec-node\devContainersSpecCLI.js:1921:1698)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async DF (c:\Users\samuel.polacek\.vscode\extensions\ms-vscode-remote.remote-containers-0.284.0\dist\spec-node\devContainersSpecCLI.js:1920:3917)
    at async poe (c:\Users\samuel.polacek\.vscode\extensions\ms-vscode-remote.remote-containers-0.284.0\dist\spec-node\devContainersSpecCLI.js:2059:26903)
    at async doe (c:\Users\samuel.polacek\.vscode\extensions\ms-vscode-remote.remote-containers-0.284.0\dist\spec-node\devContainersSpecCLI.js:2059:25026)
{"outcome":"error","message":"Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\\Users\\SAMUEL~1.POL\\AppData\\Local\\Temp\\devcontainercli\\container-features\\0.32.0-1678865679652\\Dockerfile-with-features -t vsc-software-31eb9ee92803919de749f062f644c234 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label c:\\dev\\XPS\\Software\\.devcontainer","description":"An error occurred building the image."}

I tried to run the command devcontainer runs separately and that produces the same error:

> docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f C:\Users\SAMUEL~1.POL\AppData\Local\Temp\devcontainercli\container-features\0.32.0-1678865247929\Dockerfile-with-features -t vsc-software-31eb9ee92803919de749f062f644c234 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label c:\dev\XPS\Software\.devcontainer
2023/03/15 08:36:34 http2: server: error reading preface from client //./pipe/docker_engine: file has already been closed
[+] Building 0.0s (2/2) FINISHED
 => [internal] load build definition from Dockerfile-with-features                                                                                                                                                                                                                                     0.0s 
 => => transferring dockerfile: 246B                                                                                                                                                                                                                                                                   0.0s 
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                      0.0s 
 => => transferring context: 2B                                                                                                                                                                                                                                                                        0.0s 
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to mount in-place: {bind C:\ProgramData\Docker\windowsfilter\m2ojs66ypkp47r1ye6evbmvbb [rbind ro]}: invalid windows mount type: 'bind'
> devcontainer.cmd --version
0.32.0

Docker Desktop settings

{
  "experimental": true,
  "features": {
    "buildkit": true
  }
}

I tried setting "buildkit": false, but that does not work either.

Can someone point me in the right direction? There has to be some misconfiguration on my side that I struggle to understand and I can't diagnose.

> docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.10.3)
  compose: Docker Compose (Docker Inc., v2.15.1)
  dev: Docker Dev Environments (Docker Inc., v0.1.0)
  extension: Manages Docker extensions (Docker Inc., v0.2.18)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.25.0)
  scout: Command line tool for Docker Scout (Docker Inc., v0.6.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 1
 Server Version: 20.10.23
 Storage Driver: windowsfilter (windows) lcow (linux)
  Windows:
  LCOW:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 19044 (19041.1.amd64fre.vb_release.191206-1406)
 Operating System: Windows 10 Enterprise Version 2009 (OS Build 19044.2604)
 OSType: windows
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.76GiB
 Name: CZBRN-5D1F1Z2
 ID: STYO:R3BR:SIE5:4IXN:X55H:4BU5:WYDA:6YZL:FOVX:WTPD:BL5X:LVB3
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

devcontainer.json

{
	"name": "Windows test",
	
	"build":{
		"dockerfile": "Dockerfile"
	}
}

Dockerfile

FROM mcr.microsoft.com/windows:ltsc2019
@samruddhikhandale
Copy link
Member

Looks similar to microsoft/vscode-remote-release#7394

@samopolacek Do you have Docker Desktop or Docker CLI installed?

@samopolacek
Copy link
Author

I have Docker Desktop. I will try to uninstall WSL, reinstall Docker Desktop and report back.

@samopolacek
Copy link
Author

samopolacek commented Mar 16, 2023

I have uninstalled Ubuntu, uninstalled WSL, reinstalled Docker Desktop. Still the same error message.
Turning on/off "Use the WSL 2 based engine" in Docker Desktop settings does not help either.

@chrmarti
Copy link
Contributor

Support for Windows containers is tracked with microsoft/vscode-remote-release#445. Currently only Linux containers are supported.

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

No branches or pull requests

3 participants