Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 958 Bytes

chapter-4-working-with-pods-podman.md

File metadata and controls

41 lines (33 loc) · 958 Bytes

Chapter 4: Working with Pods in Podman

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.

Key Commands:

  1. Create a Pod:

    podman pod create --name mypod --hostname mypodhost
    • Creates a pod with a custom name and hostname.
  2. Add a Container to a Pod:

    podman run --pod mypod -d nginx
    • Runs a container within the specified pod.
  3. Start a Pod:

    podman pod start mypod
    • Starts all containers in the pod.
  4. Stop a Pod:

    podman pod stop mypod
    • Stops all running containers within the pod.
  5. List Pods:

    podman pod list
    • Displays details of all pods.
  6. Remove a Pod:

    podman pod rm mypod
    • Deletes a pod and its containers (use -f to force).