-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Issue Description
I transitioned from Docker to Podman and docker run --mount source=volume-name,target=/target stopped working.
Steps to reproduce the issue
$ podman run --mount source=volume-name,target=/target golang:1.24.2
Error: incorrect mount format: should be --mount type=<bind|glob|tmpfs|volume>,[src=<host-dir|volume-name>,]target=<ctr-dir>[,options]
Describe the results you received
The error above.
Describe the results you expected
I expected this to work because I'm currently transitioning from Docker to Podman, so I expected all commands and flags to work the same with no changes needed.
The style of flag above worked on Docker; I assume they treat --mount source=volume-name,target=/target as having a default type of some kind, although from looking at the docs and man pages, I'm not even sure what that would be.
I resolved the issue by using --mount type=volume,source=volume-name,target=/target, which is more explicit and follows the docs. But you might still want to investigate this discrepancy with Docker's docker run --mount behavior.
podman info output
Client: Podman Engine
Version: 5.4.2
API Version: 5.4.2
Go Version: go1.24.1
Git Commit: be85287fcf4590961614ee37be65eeb315e5d9ff
Built: Wed Apr 2 01:00:00 2025
Build Origin: Fedora Project
OS/Arch: linux/amd64Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response