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

Mounting does not work if files are located in a volume #830

Open
1 of 5 tasks
matthiashamacher opened this issue Oct 11, 2023 · 4 comments
Open
1 of 5 tasks

Mounting does not work if files are located in a volume #830

matthiashamacher opened this issue Oct 11, 2023 · 4 comments

Comments

@matthiashamacher
Copy link

Description

I have all my projects in a macOS Volume /Volumes/Projects. When I try to start the container via docker compose I get an error
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/Volumes/Projects/PROJECT_PATH/docker/crontab" to rootfs at "/crontab": mount /Volumes/Projects/PROJECT_PATH/docker/crontab:/crontab (via /proc/self/fd/6), flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

As I just figured out it's because of the location. If I move the files to i.e. ~/test and start it there everything works fine. Is there a possibility via configuration i.e. to make that work?

Version

Colima Version: 0.5.6
Lima Version: 0.17.2
Qemu Version: 8.1.1

Operating System

  • macOS Intel <= 12 (Monterrey)
  • macOS Intel >= 13 (Ventura)
  • macOS M1 <= 12 (Monterrey)
  • macOS M1 >= 13 (Ventura)
  • Linux

Output of 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/matthiashamacher/.colima/default/docker.sock

Reproduction Steps

  1. Create a new volume in the macOS Disk Utility
  2. Have a docker compose with mounted files
  3. Start the containers via docker compose up

Expected behaviour

Everything works all mounts can be established

Additional context

No response

@taher-pro
Copy link

@matthiashamacher I faced this issue and found the solution at #144 (comment)

Check if that works for you.

@shock
Copy link

shock commented Jun 25, 2024

I'm having the same issue. @matthiashamacher - did you ever get around it? I tried changing the socket soft link, per #144 (comment), but I'm still getting the error. I'm wondering if it has to do with macOS SIP and granting colima access to external volumes.

colima version 0.6.9
Sonoma 14.5
Mac mini M1 2021

@cachescrubber
Copy link

I just stumbled upon this ... Try to add a mount entry to colima.yaml

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

After restarting Colima I am able to bind-mount directories from /Volumes/Git.

@cachescrubber
Copy link

Just realized it is part of the FAQ - https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#issue-with-docker-bind-mount-showing-empty

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

4 participants