Open igor-petrik-invitae opened 1 year ago
I can see the conflict, but mounting subdirectories of /usr/local
is not really recommended or supported. If you were to mount /usr/local/bin
you would break Rancher Desktop.
Since you are already using an override.yaml
file, is there a reason not to mount the host directory to a different location inside the VM? Something like this:
mounts:
- location: /usr/local/share/data_for_rancher
mountPoint: /opt/share/data_for_rancher
writable: true
Sure, there are workarounds. This isn't a blocker.
The only reason I am trying to do this at the moment is because I am migrating an existing project from Docker Desktop, and our existing docker commands/compose files expect things to be mounted in such paths, and we are trying not to have to modify all those parts of the code-base.
And sure, there are places where it's not a good idea to mount, but I feel that it shouldn't be explicitly denied. I used /usr/local/
in this example because that was where I was having issues. But you can see that /tmp
is also mounted after host mounts and (I assume) would also be affected by this bug. Are you saying that mounting a host path into /tmp
is also not supported?
Moreover, the fact that the behavior is different depending on mount type is confusing, and that it just fails silently leads to a lot of head scratching.
Also, for what it's worth, mount order works as expected in colima
0.5.5/lima
0.16.0.
it shouldn't be explicitly denied
It is just a side-effect of the implementation. We would have to unmount/remount these directories to mount them in the correct order.
Are you saying that mounting a host path into
/tmp
is also not supported?
No, there shouldn't be anything in the system that relies on specific files in /tmp
to be present. The only reason it is mounted to the data volume is because by default it is on tmpfs
in RAM, so competes for memory with your containers. I would recommend against mapping all of /tmp
to the host though, as that would be quite slow.
Moreover, the fact that the behavior is different depending on mount type is confusing, and that it just fails silently leads to a lot of head scratching.
Again, a side effect of how it is implemented in Lima. reverse-sshfs
is mounted manually because sshfs
may not be available during first-boot. 9p
and virtiofs
are mounted as part of the regular boot sequence.
I understand the above situation. But there are tools like AWS Toolkit that mount and use the under /tmp folder like "/tmp/aws-toolkit-vscode" and below, so I want you to be able to mount any folder if possible.
I think this problem is caused by rancher-sandbox/alpine-lima#15, but this is a change specific to rancher-desktop, so it shouldn't happen in colima. (Sorry, butI don't know how to balance this PR and this issue)
Actual Behavior
A host folder mounted from e.g.
/usr/local/share
is unavailable in the lima VM, because they get mounted before/dev/disk/by-label/data-volume on /usr/local type ext4 (rw,relatime)
, when using mount type9p
orvirtiofs
.Steps to Reproduce
Before testing each different mount type:
rdctl factory-reset
Result
reverse-sshfs
(works as expected):9p
:virtiofs
:Expected Behavior
In all mount types, host mounts should be mounted after all other mounts, so that they don't get overridden.
Additional Information
No response
Rancher Desktop Version
1.9.1
Rancher Desktop K8s Version
None
Which container engine are you using?
moby (docker cli)
What operating system are you using?
macOS
Operating System / Build Version
13.5 (22G74)
What CPU architecture are you using?
x64
Linux only: what package format did you use to install Rancher Desktop?
None
Windows User Only
No response