for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Docker fails with Dev Drive

Open anthonyvdotbe opened this issue 1 year ago • 4 comments

Description

When using a Dev Drive, commands fail with:

failed to solve: failed to read dockerfile: error from sender: resolve : EvalSymlinks: too many links

Reproduce

  • Set up a Dev Drive
    • do not assign a drive letter
    • mount it to C:\Users\me\MyDevDrive
    • run fsutil devdrv setFiltersAllowed "PrjFlt, WdFilter, bindFlt, wcifs"
  • create C:\Users\me\MyDevDrive\Dockerfile with content FROM azul/zulu-openjdk:6u119
  • create C:\Users\me\MyDevDrive\docker-compose.yaml with content
version: '3'
services:
  app:
    build: .
  • in C:\Users\me\MyDevDrive, run docker build .
  • in C:\Users\me\MyDevDrive, run docker compose build
  • create C:\Users\me\MyDevDrive\subfolder\Dockerfile with content FROM azul/zulu-openjdk:6u119
  • create C:\Users\me\MyDevDrive\subfolder\docker-compose.yaml with content
version: '3'
services:
  app:
    build: .
  • in C:\Users\me\MyDevDrive\subfolder, run docker build .
  • in C:\Users\me\MyDevDrive\subfolder, run docker compose build

Expected behavior

All commands succeed.

Actual behavior: only the command docker build . succeeds, and only so when run from within subfolder, not in the root of the Dev Drive.

docker version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:32:48 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.24.0 (122432)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:32:16 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    24.0.6
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.22.0-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.8
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.7
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 25
  Running: 9
  Paused: 0
  Stopped: 16
 Images: 72
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.90.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 7.566GiB
 Name: docker-desktop
 ID: 486feb26-5063-4d1a-9016-fd9860a4f05c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

DD9590D4-7705-401A-B7DC-95AFAF77F823/20231003162914

Additional Info

No response

anthonyvdotbe avatar Oct 03 '23 16:10 anthonyvdotbe

maybe this helps:

fsutil devdrv query d:
This is a trusted developer volume.

Developer volumes are protected by antivirus filter.

Filters allowed on any developer volume:
    PrjFlt, bindFlt, wcifs, WdFilter

Filters allowed on this developer volume:
    PrjFlt, bindFlt, wcifs, WdFilter

Filters currently attached to this developer volume:
    WdFilter

bindFlt, wcifs should be activated for docker according to devdrive documentation. dont know how filters works, if they just enbale when requested or if the should be always on. I am completly on devdrive with docker(using wsl-2 backend) and bindings do not work at all

e.g. a (aws-)cdk synth command like this fails docker run --rm -u "1000:1000" -v "D:\\Projects\\lambda\\cert_rotator:/asset-input:delegated" -v "D:\\Projects\\cdk.out\\asset.c57162457c5b93bd9733be33885cfeda014480bcf06cccb253fbc93dec2bf8fd:/asset-output:delegated" -w "/asset-input" cdk-1fdf2bfc80f4d088c66653d8f8d81b529c39aafdaec8d094443df7c9499e5f3c bash -c "rsync -rLv /asset-input/ /asset-output && cd /asset-output && python -m pip install -r requirements.txt -t /asset-output"

Error: docker exited with status 2

Further up the log OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-ouam0i64/lib/python/configobj' -> '/asset-output/configobj'

monsdroid avatar Oct 20 '23 16:10 monsdroid

Thanks, with mounting the drive as a path instead of as a drive letter, it now works.

FrankAuwers avatar Mar 14 '24 09:03 FrankAuwers

I have a postgres container mounting a local folder (in a devdrive) and it keeps freaking out about bad permissions and not starting properly.

I think there's some incompatibilities with Docker bind mounts. 🤔

darkvertex avatar Apr 18 '24 14:04 darkvertex

I have a postgres container mounting a local folder (in a devdrive) and it keeps freaking out about bad permissions and not starting properly.

I think there's some incompatibilities with Docker bind mounts. 🤔

I get the same thing for a MongoDB container. It just spins and restarts continually over permissions.

CubicleJockey avatar Apr 24 '24 22:04 CubicleJockey

Did anyone find a workaround for this? This is a pretty serious limitation for Dev Drives that limit its usefulness. We have tons of docker-compose.yml files for dev environment provisioning that bind-mount file system resources within source code repositories. When we can't use that, this completely breaks our dev workflow.

cwatzl avatar Jun 07 '24 09:06 cwatzl