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

APFS Volume not correctly mounting in docker container #1051

Closed
1 of 5 tasks
nnathan opened this issue Jun 26, 2024 · 2 comments
Closed
1 of 5 tasks

APFS Volume not correctly mounting in docker container #1051

nnathan opened this issue Jun 26, 2024 · 2 comments

Comments

@nnathan
Copy link
Contributor

nnathan commented Jun 26, 2024

Description

Volume mount working with default system volume:

c2:code $ df -h .
Filesystem      Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk3s5   926Gi   636Gi   269Gi    71%    2.0M  2.8G    0%   /System/Volumes/Data
c2:code $ docker run -it --mount type=bind,src=$PWD,dst=/model ubuntu
root@9daa7afabc1d:/# cd /model/
root@9daa7afabc1d:/model# ls
DocExample.pdf          frr                             musl                         spiped
  .
  .
  .
root@9daa7afabc1d:/# mount | grep -i model
mount0 on /model type virtiofs (rw,relatime)

Volume mount not working using a separate volume mount (case sensitive volume):

c2:landingnet $ df -h .
Filesystem      Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk3s7   926Gi   1.5Gi   269Gi     1%     21k  2.8G    0%   /Volumes/s
c2:landingnet $ docker run -it --mount type=bind,src=$PWD,dst=/model ubuntu
root@8b715762cba0:/# cd /model/
root@8b715762cba0:/model# ls
root@8b715762cba0:/model# mount | grep -i model
/dev/vda1 on /model type ext4 (rw,relatime,discard,errors=remount-ro,commit=30)

Version

c2:colima $ colima version && limactl --version && qemu-img --version
colima version 0.6.9
git commit: c3a31ed05f5fab8b2cdbae835198e8fb1717fd0f

runtime: docker
arch: aarch64
client: v26.1.3
server: v26.1.1
limactl version 0.22.0
qemu-img version 9.0.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

  • macOS Intel <= 13 (Ventura)
  • macOS Intel >= 14 (Sonoma)
  • Apple Silicon <= 13 (Ventura)
  • Apple Silicon >= 14 (Sonoma)
  • Linux

Output of colima status

c2:colima $ colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/naveen/.colima/default/docker.sock

Reproduction Steps

  1. Use Disk Utility to create an APFS Volume
  2. Run docker run -it -v /Volume/${VOLUME_NAME}:/model ubuntu
  3. Check mount | grep model, if it shows up as ext4 then the volume mount didn't work and the volume mountpoint is empty.

Expected behaviour

Expect the volume mount point to be populated with whatever is on the host filesystem and not empty.

Additional context

No response

@nnathan
Copy link
Contributor Author

nnathan commented Jun 27, 2024

I have an inkling that this is probably a permissions / restriction of mounting from /Volumes/** in Docker. I just don't know how to interrogate the list of directories that are allowed to be mounted. Would appreciate some assistance.

@nnathan
Copy link
Contributor Author

nnathan commented Jun 27, 2024

Issue resolved thanks to the explanation in #515.

Just had to add the mountpoint in the colima.yaml:

mounts:
  - location: /Volumes/myvol
    writable: true

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

1 participant