Hacker News new | ask | show | jobs
by rgovostes 811 days ago
> Can you elaborate on the host directories bit? I'm curious what you mean.

Realize that when you are running podman on macOS, all of your containers are really running inside a Fedora virtual machine, and the `podman` (and `docker`) commands you execute are remotely controlling what's happening on this virtual machine.

So when you use -v to mount a file or directory into your container, you're really mounting it from the virtual machine, not your macOS host. For example:

    $ podman run --rm -v /etc/os-release:/foo debian head -n 1 /foo
    NAME="Fedora Linux"  # this file doesn't exist on macOS
But obviously you wanted to mount a directory from your macOS host into the container. Podman accomplishes this by creating some network mounts for a few directories on your macOS host, like /Users, at the same path inside the container. Presto, `-v /Users/itsautomatisch/Stuff:/stuff` works like you wanted.

If you want to be able to mount another macOS directory that Podman doesn't do by default, like /Volumes/Stuff, you have to recreate the podman machine VM (`podman machine rm && podman machine init -v /Volumes/Stuff`) but it clears the default list if you do this.