Podman
Introduction
Podman is a deamonless container engine for developing, managing, and running OCI Containers on your Linux System.
References
Podman
Podman installation instructions (eg: Windows w/ WSL 2)
https://podman.io/getting-started/installation
Update installation instructions to use podman in a WSL machine
https://github.com/containers/podman.io/issues/431
Install on Windows 10 w/ WSL 2
Ubuntu 20.10 and newer
a) Install podman
sudo apt-get update && sudo apt-get -y install podman
b) Emulate Docker CLI using podman
sudo apt install podman-docker && sudo touch /etc/containers/nodocker
Ubuntu 20.04 LTS
a)Add the Podman PPA and install Podman
. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install podman
sudo mkdir -p /etc/containers
echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | sudo tee /etc/containers/registries.conf
b)Rootless configuration file changes
sudo nano /usr/share/containers/containers.conf
Change the value of events_logger to:
events_logger = "file"
c1) Emulate Docker CLI using podman
sudo apt install podman-docker
sudo touch /etc/containers/nodocker
c2) (Avoid it, use it only as alternative to the 'podman-docker' package) Symlink docker to podman
(only if podman-docker doesn't work) sudo ln -s /usr/bin/podman /usr/bin/docker
Note: Aliases aren't picked up by shell scripts
Try it out
Execute:
docker run hello-world
Or, if not symlink docker->podman has been created:
podman run hello-world
podman play kube vs Podman Compose vs Docker Compose
Neither 'Podman Compose' nor 'Docker Compose ' is affiliated with Podman (Podman Compose is a community project, not directly maintained by the Podman team).
Note: Docker Compose, as Docker itself, needs a license for commercial use.
Podman is hard at work at work on podman generate kube and podman play kube, which allow Kubernetes YAML to be used directly with Podman.
>"Podman Compose or Docker Compose: Which should you use in Podman?" (June 17, 2022 )
https://www.redhat.com/sysadmin/podman-compose-docker-compose
>podman-play-kube ubuntu manpage
https://manpages.ubuntu.com/manpages/jammy/man1/podman-play-kube.1.html
Troubleshooting
ERRO[0000] error loading cached network config: network "podman" not found in CNI cache
On Windows 11 WSL2 w/ Ubuntu 22.04 using podman 3.4.2
Workaround is to switch back to iptables-legacy:
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
Just a warning, ignore it if everything works fine. It might affect mounting filesystems. Warning appeared using Podman 3.4.2. The solution might be (UNTESTED):
sudo mount --make-rshared /