-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[WIP] Volume mount paths compatibility on darwin #13453
[WIP] Volume mount paths compatibility on darwin #13453
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tricktron The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The remote client is generic and not just limited to podman machine. You cannot just change the path for all darwin installs. This will break a lot of things. |
863fe99
to
3ad9e0a
Compare
@Luap99 I was developing that in parallel to @baude's solution and since it worked well enough I wanted it to share it here. According to the tests, it doesn't even break that much. I lack the broader background to judge which solution is better. But in my opinion it doesn't make sense to use an immutable / only to disable it for mounting and then reenabling it again. But this is up to you and the community to decide, this are just my 2 cents. |
we are hoping to work with the fcos community to provide a better long-term solution. we kicked around some ideas the other day but never really came to a conclusion. @dustymabe @cgwalters here is a pr that cleans up some of what I did but nevertheless shows we need to figure this out ... i dont think i knew the other day that docker compose defaults to using / !! |
Well only because macos/windows and podman machine are completely untested! |
Do you know a way to test this manually? |
Signed-off-by: Thibault Gagnaux <[email protected]>
CoreOS disallows mounting at `/`root because it is [immutable](https://docs.fedoraproject.org/en-US/fedora-coreos/storage/#_immutable_read_only_usr). As an alternative, it is recommended to mount at `/mnt`, e.g: `podman machine init -v /Users:/mnt/Users` on darwin. This, however, breaks compatibility with other tools, e.g. docker desktop, colima when specifying mounts: ```config \# docker-compose.yml ... volumes: - ./app:/app ``` - Works in colima and docker desktop. - Fails with `podman run` because it is missing the `/mnt` prefix. As a result, I can't use podman and docker desktop interchangeably with one single `docker-compose.yml` file. This WIP tries to solve that with the following convention: - `podman machine:` every target mount path into coreOS is internally prefixed with `/mnt` so that it can be mounted. - `podman run`: every source mount path is internally prefixed with `/mnt` if you are on darwin. [NO NEW TESTS NEEDED] Signed-off-by: Thibault Gagnaux <[email protected]>
3ad9e0a
to
54d7552
Compare
@baude Any updates? |
We have no updates to provide on that matter. We have a temporary fix in 4.0.2 for the Mac brew client. We have also decided to mount -v $HOME:$HOME as a default in the next release. It can be overriden, changed, and also you can opt out of any mounting. |
@baude Ok, thanks for the info. Should I close this pr or keep it open? |
I would say close this, then open a PR to add fields to containers/common, for default paths to volume mount into machines machine_volumes=[ "$HOME:$HOME", "/tmp:/tmp:ro" ] Supports both environment variables and paths. |
@rhatdan This pr was an alternative solution to allow compatibility with docker-compose files without mounting at |
We can move this to a discussion. |
CoreOS disallows mounting at
/
root because it is immutable.As an alternative, it is recommended to mount at
/mnt
, e.g:podman machine init -v /Users:/mnt/Users
on darwin. This, however, breaks compatibility with other tools, e.g. docker desktop, colima when specifying mounts:podman run
because it is missing the/mnt
prefix.As a result, I can't use podman and docker desktop interchangeably
with one single
docker-compose.yml
file.This WIP tries to solve that with the following convention:
podman machine:
every target mount path into coreOS is internally prefixed with/mnt
so that it can be mounted.podman run
: every source mount path is internally prefixed with/mnt
if youare on darwin.
Now the last sentence if youare on darwin may break a lot stuff, e.g what happens when using the podman remote client on linux with server vs. when using it with a linux vm. Since I am brand new to this project, it may very well be that this approach is heading into the wrong direction. But it at least works on my m1 Mac and may serve as a good starting point for a discussion for v4.1.
There are multiple approaches to solving this issue. I can currently think of 4:
podman/pkg/machine/qemu/machine.go
Lines 477 to 488 in 4a242b1
/mnt
, then disabling the immutability using the above trick by @baude, then creating a symlink in root, then enabling immutability again.