Podman Pods
podman(1) introduces the concept of pods to address the most common needs of networking between containers.
Example
Within a pod, containers act like they are running on the same machine. They can communicate to each other through conventional Linux networking.
$ podman run --detach --name my-nginx \
--pod new:my-pod \
nginx:latest
$ podman run --interactive --tty --name my-alpine \
--pod my-pod \
alpine:latest
# apk add curl
[ ... ]
# curl http://localhost
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
[ ... ]Note that containers within a pod must avoid already-bound ports.
Creating Pods
As demonstrated above, it is possible to create a pod with a new container.
To only create a new pod, try:
podman pod create my-pod
To list pods, try:
podman pod ps
Destroying Pods
To destroy a pod, try:
podman pod rm my-pod
Note that destroying a pod necessarily means destroying all containers in it.
