Files
homelab/active/software_podman/podman.md
T
2026-09-07 11:37:56 -04:00

1.3 KiB

Podman

Networks

# Create a podman network to group shared containers
podman network create test1
# Create an iperf3 container running on that network
podman run -d --name iperf3 --network test1 docker.io/networkstatic/iperf3 -s
# A container running in the same network can reference another pod by its name
podman run --rm -it --network test1 docker.io/networkstatic/iperf3 -c iperf3
# A container outside the created network can't talk to other containers
# This will fail
podman run --rm -it docker.io/networkstatic/iperf3 -c iperf3

Healthchecks

TCP Healthchecks can be accomplished with netcat (netcat-openbsd)

podman run -d --name iperf3 \
--health-cmd='CMD-SHELL iperf3 -n 1 -c localhost' \
--health-interval=10s --health-timeout=5s --health-retries=3 \
docker.io/networkstatic/iperf3 iperf3 -s

HTTP Healthchecks can be accomplished with curl

podman run -d --name nginx \
--health-cmd='CMD-SHELL curl --fail http://127.0.0.1:80 || exit 1' \
--health-interval=10s --health-timeout=5s --health-retries=3 \
docker.io/nginx

Check healthchecks with

podman --log-level debug healthcheck run <container>

Volume Import and Export

podman volume export myvol --output myvol.tar
podman volume import myvol test.tar