Pods in Podman mimic Kubernetes pods, allowing multiple containers to share the same network and namespaces. This chapter covers the essential commands and concepts for managing pods.
-
Create a Pod:
podman pod create --name mypod --hostname mypodhost
- Creates a pod with a custom name and hostname.
-
Add a Container to a Pod:
podman run --pod mypod -d nginx
- Runs a container within the specified pod.
-
Start a Pod:
podman pod start mypod
- Starts all containers in the pod.
-
Stop a Pod:
podman pod stop mypod
- Stops all running containers within the pod.
-
List Pods:
podman pod list
- Displays details of all pods.
-
Remove a Pod:
podman pod rm mypod
- Deletes a pod and its containers (use
-f
to force).
- Deletes a pod and its containers (use