-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Build-time bind mount not working on OSX #16694
Comments
It works as designed at the moment. The podman machine VM shares predefined mounts with the host, they must be given at podman machine init time. By default only $HOME is mounted, if you want to mount something else you need to recreate the vm, see https://docs.podman.io/en/latest/markdown/podman-machine-init.1.html#volume-v-source-target-options I think @ashley-cui has been started to work on dynamic mounting for machine VM but I am not sure what the state there is? |
Current state is the work is put on pause, as we need more research and design. It's definitely high priority for us though. |
@Luap99 , @ashley-cui I am, in fact, mounting from my home directory (from $(HOME)/tmp). The above was an effort to simplify things to explain the issue. I am able to write to the shared volume from the container and see those changes after I build, but not during the build. Is there some other action I need to take to be able to actually write to the shared volume during the container build? |
I don't understand what that means? Looking at the man page it says podman build --volume is not supported with the remote client. |
When I am building the container, I write files into the shared volume. Those changes do NOT show up on the host. After the container is built, I can make changes to the shared volume while running the container and I see those changes on my host. As in the original example, if during a container build, I touch a file in the shared volume, I do not see that file on my host. After the build, if I look at the shared volume in the container, I do not see the file either. But, after building the container, I can , e.g. Does that help? |
podman build tar's up the local content and the install happens on the server side. Is not supported on MAC and Windows boxes or any remote client. |
podman build --volume should be supported on the remote client as well. It works for |
Just like podman-remote run users should still be able to set volumes, of course the source must be on the server machine but this is already the case for podman machine for example. Fixes containers#16694 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
/kind bug
Description
Bind mounts do not work when running on OSX, have tried from OSX terminal and from within the podman virtual machine.
Have tried rootless and rootful machines - neither seem to work.
Steps to reproduce the issue:
cat Containerfile
FROM fedora
RUN touch /srv/foo.txt
podman build -f Containerfile -v /tmp:/srv
STEP 1/2: FROM fedora
STEP 2/2: RUN touch /srv/foo.txt
--> Using cache 636aff403de1a619ab3fd10e308d4e759232f9651a039e1a72dee88a207981e2
--> 636aff403de
636aff403de1a619ab3fd10e308d4e759232f9651a039e1a72dee88a207981e2
ls /tmp/foo.txt
ls: /tmp/foo.txt: No such file or directory
Describe the results you received:
The bind mount does not appear to be working (I do not see the file on my host file system as expected). I DO see the file being created on the COW filesystem in the container.
Describe the results you expected:
I expect the file to be created on my host.
Additional information you deem important (e.g. issue happens only occasionally):
Happens every time.
Output of
podman version
:Output of
podman info
:Package info (e.g. output of
rpm -q podman
orapt list podman
orbrew info podman
):From within the podman virtual machine
Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
OSX 13.0.1, Podman Desktop (not sure which version, just installed it from Podman.io 2 days ago).
The text was updated successfully, but these errors were encountered: