Volume option does fails with missing host directories #19266
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
remote
Problem is in podman-remote
Issue Description
When running commands designed for docker using the
-v
option to attach volumes, Podman can fail where the directory does not yet exist on the host. Users will get the error:However, Docker will create the folder (source):
Given that one of Podman's aims is to provide "Support for a Docker-compatible CLI interface", it'd feels like a bug that we don't match Docker's (reasonable) behaviour here of creating the volume folder if one does not exist and the user has permissions to create that folder. Supporting this would make the CLIs more compatible and therefore make it easier for people to use Podman in place of Docker.
Steps to reproduce the issue
Run
podman run -v /doesnt/exist:/foo -w /foo -i -t ubuntu bash
Describe the results you received
Receive the error:
Error: statfs /doesnt/exist: no such file or directory
Describe the results you expected
As a Docker-compatible CLI, the directory
/doesnt/exist
is created and the container runs with the container folder/foo
attached to the (new) host folder/doesnt/exist
.podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: