-
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
Run command podman -v /source_volume:/container_dir and it throw an error Error: statfs /source_volume: no such file or directory #14781
Comments
Hi @geekerNo1 Thanks for creating the issue. In following command I am not sure if podman should attempt to create a named volume where name actually looks like a path on host since this could lead to scenarios where Tagging @containers/podman-maintainers for input here. |
Hi @flouthoc Thanks for you reply.
I attempt to use
So I guess that this is a difference between docker and podman, right? |
@geekerNo1 Thanks for making it clear. I can also confirm |
I think the Podman behavior is saner. It helps to find out typos more easily. e.g. something like |
This was discussed before and we (Podman maintainers) think this is a bug. What if you have a typo now podman creates a new empty directory and does not use the one you intended or what if you want to bind mount a file and the file simply does not exists? |
All of them are closed and the docs seem to be wrong. I suggest reopening and reflecting the reasoning in the docs. |
Which docs are you talking about? I see this:
|
Ah i see but I don't think this is bug at docker end but more like expected behavior on the docker side. The docs here mention this behavior https://docs.docker.com/engine/reference/commandline/run/#mount-volume--v---read-only "When the host directory of a bind-mounted volume doesn’t exist, Docker will automatically create this directory on the host for you" But reasoning here makes sense to me: #6234 (comment) |
See the issue description. The doc also states "If no such named volume exists, Podman will create one". The two conflict and if users look for that information they will very likely stop reading at some point. |
Podman is working correctly. We should NOT create the source directory. Docker might do this but I see it as a bug. If the docs say that we create the source directory then the docs need to be fixed. |
Reopening as the docs should be less confusing. |
Thanks all helps! Now I got it. Close the issue. |
(duplicate of #6234) |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
Accodring to doc https://docs.podman.io/en/latest/markdown/podman-run.1.html. Podman -v will mount the source volume to container dir. If no such named volume exists, podman will create one.
But when I mount an volume which is not exists, it will throw an error, "Error: statfs /volume_dir: no such file or directory"
Steps to reproduce the issue:
Error: statfs /tmp/abcd: no such file or directory
Error: statfs /tmp/abcd: no such file or directory
Output of
podman version
:The text was updated successfully, but these errors were encountered: