Recently switched from Docker Desktop to Podman, everything work smoothly except when I want to mount host volume into container. e.g.
➜ ~ podman run --name nginx -v ~/bin/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -d -p 8080:80 nginx
Error: statfs /Users/rb/bin/nginx/nginx.conf: no such file or directory
➜ ~ ls -lt ~/bin/nginx/nginx.conf
-rw-r--r-- 1 rb staff 490 Apr 23 14:31 /Users/rb/bin/nginx/nginx.conf
The host file ~/bin/nginx/nginx.conf
do exist, so what's the problem here?
Try the following:
Restart of VM:
podman machine stop; podman machine start
As @rafagarci mentioned in comments, sometimes new start failed and you should run these commands again a few times.
Then mount (-v
) works fine.
If restart doesn't help then try to recreate your podman machine:
podman machine stop
podman machine rm
podman machine init # you may specify parameters for your VM
podman machine start
In documentation you may find parameters for podman machine init
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With