docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

lyMounts to a APFS container with more than one APFS volume do not resolved corrected. #6866

Open ackerthehacker2 opened 1 year ago

ackerthehacker2 commented 1 year ago

Description

I have a APFS container with two APFS volumes in it. /Volumes/tmp. and /Volumes/qbit

In my docker-compose,

volumes:
  - /Volumes/tmp:/proj
  - /Volumes/qbit:/qbit

What happens is I don't see the file structure of /Volumes/tmp under /proj but rather /Volumes/qbit contents under /proj (and under /qbit as expected).

Reproduce

  1. Create a APFS Container
  2. Create 2 APFS Volume .. "a" and "b" (/Volumes/tmp. and /Volumes/proj
  3. Create a docker instance that mount /Volumes/tmp:/z and /Volumes/proj:/y with a volumes statement.

touch yyy. in /Volumes/tmp. on the host..

Got to the terminal of the container and do a ls -l /y and of /z/. While they are different volumes, they will have the same contents even though they are different.

Expected behavior

/a has the contents of /Volumes/tmp and /b has the contents of /Volumes/proj

docker version

Client:
 Cloud integration: v1.0.31
 Version:           23.0.5
 API version:       1.42
 Go version:        go1.19.8
 Git commit:        bc4487a
 Built:             Wed Apr 26 16:12:52 2023
 OS/Arch:           darwin/arm64
 Context:           default

Server: Docker Desktop 4.19.0 (106363)
 Engine:
  Version:          23.0.5
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.8
  Git commit:       94d3ad6
  Built:            Wed Apr 26 16:17:14 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.20
  GitCommit:        2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc:
  Version:          1.1.5
  GitCommit:        v1.1.5-0-gf19387a
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /Users/dougacker/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.17.3
    Path:     /Users/dougacker/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/dougacker/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.19
    Path:     /Users/dougacker/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.4
    Path:     /Users/dougacker/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/dougacker/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/dougacker/.docker/cli-plugins/docker-scan
  scout: Command line tool for Docker Scout (Docker Inc.)
    Version:  v0.10.0
    Path:     /Users/dougacker/.docker/cli-plugins/docker-scout

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 23.0.5
 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: 2
 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: 2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc version: v1.1.5-0-gf19387a
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.667GiB
 Name: docker-desktop
 ID: 2ddc6e13-0473-4e6a-b4f6-6058ef09a635
 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
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Diagnostics ID

60F715FF-298F-4967-9241-D3D4673B6A4F/20230604162219

Additional Info

No response

milas commented 1 year ago

I'm not able to reproduce this:

APFS container with two volumes:

/dev/disk4 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +94.7 GB    disk4
                                 Physical Store disk0s5
   1:                APFS Volume b                       839.7 KB   disk4s1
   2:                APFS Volume a                       823.3 KB   disk4s2
❯ ls -R /Volumes/a
a

❯ ls -R /Volumes/b
b

compose.yaml

services:
  echo:
    image: alpine
    command: ['sh', '-c', 'ls -R /a && ls -R /b']
    volumes:
     - /Volumes/a:/a
     - /Volumes/b:/b

Running:

❯ docker compose run echo
[+] Running 1/0
 ✔ Network apfs_default  Created                                                                                                                       0.0s
/a:
a
/b:
b

A couple suggestions: