Podman

Podman is tool for running Linux containers. Unlike docker, Podman does not require a daemon to be running on host and excells at running unpriviledged containers (rootless mode).

Debian Bullseye


apt install python3-pip
pip3 install --user podman-compose

https://wiki.csclub.uwaterloo.ca/Podman

https://github.com/docker/awesome-compose

You can also run docker-compose with podman as an unprivileged user.

Install on Fedora

dnf install podman podman-compose

Check this article

Install on EL8

To install on CentOS8 / RHEL8

yum install podman
yum install python3
pip3 install podman-compose

(podman-compose is not yet bundled with EL8/EPEL so you need to use pip3)

/etc/cni/net.d/87-podman-bridge.conflist

Test podman

Run and enter an alpine container

podman run -it --rm alpine sh

Run a CentOS 7 container

podman run -it --rm centos:7 echo "Hello world!"
podman run -it --rm -p 3000:3000 -p 8080:8080 --name pw2 cybertec/pgwatch2

alpine based java image (openjdk:14-alpine) test

podman run -it openjdk:14-alpine java -version

Connecting to host

Unpriviledged (rootless mode) containers run in their own isolated network namespace (slirp4netns - which only allows connecting from container to outside world and container:host port mapping). You can’t use localhost to connect to host.

10.0.2.3 is DNS server provided to container.

You may run “ip addr show” on host to check host IP addresses that you can use to connect from container. Prefer cni-podmanX interface’s IP address. Also, make sure firewall is not blocking connections.

You can also spin a test alpine container then find out host ip (by checking the default route) as seen from container and then use that IP to connect your containers to the host IP

podman run -it --rm alpine ip route

Useful Commands

Enter into container:

podman exec -it <container-id> /bin/bash

Troubleshooting

Fix Error in namespace after reboot by running:

(you need to run it every time the user namespace configuration is changed )

podman system migrate

Testing podman startup issues

podman run -d --log-level=debug -p 127.0.0.1:8787:8787 docker.io/library/alpine 2> /tmp/podman.log

Check all the metadata of a container:

podman inspect <ctname>