Installing Podman remote client on macOS using vagrant

Installing Podman remote client on macOS using vagrant

Installing podman as a remote client on macOS using vagrant. Vagrant setup is not covered in this post.

Podman remote client

Podman is the tool to start and manage containers. On macOS we have to use a thin remote-client that connects to a real Podman process running on a Linux host.

Here are the main steps how to configure the remote-client to work with a Linux host:

  • Create a linux machine using Vagrant
  • Set key based ssh as root to the Linux host
  • Install remote-client binary with Homebrew: brew cask install podman

Create a fedora vagrant box.

mkdir fedora-box && cd fedora-box
echo "Vagrant.configure("2") do |config| = "generic/fedora30"
  config.vm.hostname = "fedora30"
  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
    v.cpus = 1
end" >> Vagrantfile
vagrant up && vagrant ssh

On macOS create new ssh keys and copy newly generated public key.

cat ~/.ssh/
ssh-rsa AAAAB3...

Add ssh keys copied earlier on linux host to .ssh/authorized_keys.

echo "ssh-rsa AAAAB3..." >> /root/.ssh/authorized_keys

On linux host install Podman and varlink socket. This is used by the remote-client to execute commands calling Podman’s API.

sudo dnf --enablerepo=updates-testing install podman libvarlink-util libvarlink

Install podman on macOS using homebrew

brew cask install podman

Once podman is installed, create a connection parameters in $HOME/.config/containers/podman-remote.conf

cat <<EOF >$HOME/.config/containers/podman-remote.conf
    destination = ""
    username = "root"
    default = true
    port = 2222

# With the remoting file configured we can run podman simply as:
podman images

Verify running a container:

podman run --name tomcat -d
Trying to pull

Building images:

Note: The podman-remote.conf file seems to be ignored by the podman build command, so we have to add --remote-host --username root --port 2222 to each command

podman --remote-host --username root --port 2222 build --tag mytag .
Built with Hugo
Theme Stack designed by Jimmy