Use a Fedora 36 (May 10, 2022) provided Vagrant box to run Podman, and MacOS to run the Podman client.
For x86_64 VirtualBox and LibVirt hosts.
git clone https://gist.github.com/craig-m-unsw/db5cf800b8057f8e8401fde017c0c01b fedora-podman-vm
cd fedora-podman-vm
cat <<'EOF' >> .gitignore
.vagrant
local/
*.log
EOF
mkdir -pv local/
touch local/test.txt
Start the VM with Podman:
vagrant validate Vagrantfile
vagrant up
Testing the VM, login and start a container called test123
.
vagrant ssh
tmux
podman info
podman --remote info
# Red Hat 8 Universal Base Image
podman run --name=test123 -it registry.access.redhat.com/ubi8/ubi /bin/bash
You should have a root shell in this RH8 Universal Base Image now, if you run podman ps
from another shell in the VM you can see this container.
Use Podman from your host system (outside the VM).
If you want a front-end: https://github.com/containers/podman-desktop
Install podman client: https://formulae.brew.sh/formula/podman
brew install podman
Setup remote client:
myprivkey=$(vagrant ssh-config | grep IdentityFile | awk '{ print $2 }')
myport=$(vagrant ssh-config | grep Port | awk '{ print $2 }')
podman system connection add podmanvm ssh://vagrant@127.0.0.1:${myport}/run/user/1000/podman/podman.sock --identity ${myprivkey}
podman system connection list
podman info
podman ps
You should see the container test123
running still in the output to ps.
Run another container:
podman run hello-world
The Client/Server information output from podman version
Client: Podman Engine
Version: 4.2.1
API Version: 4.2.1
Go Version: go1.18.6
Built: Wed Sep 7 05:16:02 2022
OS/Arch: darwin/amd64
Server: Podman Engine
Version: 4.2.1
API Version: 4.2.1
Go Version: go1.18.5
Built: Thu Sep 8 05:58:19 2022
OS/Arch: linux/amd64
to clean up from the host run:
podman system connection remove podmanvm
vagrant destroy
See the example Dockerfile
.
Build and run from the host:
podman build . -t sysadm1
podman run -it sysadm1 /bin/bash