Podman bind mount not working with absolute path

Viewed 41

I am trying to bind mount an absolute directory with -v. I see examples showing the full path so why does it not work for me?

cd ~/src
podman run -it  \
 -v /Users/user/src/myapp:/app \
  myapp-container /bin/bash

Error: statfs /Users/user/src/myapp: no such file or directory
1 Answers

Try and follow "Favoring Podman over Docker Desktop" from Peter Butkovic (mentioned in issue 8016).

You need to create a podman machine

podman machine init --cpus=4 --disk-size=60 --memory=6096 -v $HOME:$HOME
podman machine start
mkdir test-dirtouch test-dir/test-file.txtpodman run -v ./test-dir:/opt ubuntu ls /opt
test-file.txt

Check also your podman version. PR 13849 shows "$HOME:$HOME by default in podman machine init" supported from podman 4.1+ (Apr/May 2022)

Issue 8302 does specify Volumes over remote are not supported.
The podman remote client will try to bind mount the file on the server side.

Related