podman-restart(1)

πŸ’… podman-restart(1) β€” the manual page bestie πŸ’…

okay so this is the podman-restart manual page, and honestly? it's giving "I just need to restart this one container" energy. we're gonna walk through it together, no cap. ✨


🌸 NAME 🌸

podman-restart β€” restart one or more containers 🫢


πŸ› οΈ SYNOPSIS πŸ› οΈ

podman restart [options] container ...

podman container restart [options] container ...

bestie, it's literally that simple: options first, then one or more containers. πŸ’…


πŸ’– DESCRIPTION πŸ’–

so the restart command lets you restart containers using their ID or name, periodt. here's the vibe:

  • if the container is running, it gets stopped and then restarted πŸ”
  • if the container is stopped, it just gets started up 🌱

that's it. that's the whole plot. iconic. πŸŽ€


✨ OPTIONS ✨

okay bestie, here's the full menu. every flag, every vibe. don't skip any of these, iykyk. πŸ‘‘

  • --all, -a β€” restart all containers, no matter what state they're currently in. literally all of them. πŸ”₯
  • --cidfile β€” read the container ID from the file you specify, then restart that container. you can use this multiple times. ngl, useful. πŸ“
  • --filter, -f=filter β€” filter which containers get restarted. you can stack multiple filters by using --filter multiple times. here's the tea β˜•:
    • filters with the same key work inclusive β€” except label, which is exclusive (she's different, she's main character energy)
    • filters with different keys always work exclusive

valid filters are listed below, and yes, we're listing every single one because bestie deserves the full picture:

  • id β€” [ID] Container's ID (CID prefix match by default; accepts regex) πŸ’€
  • name β€” [Name] Container's name (accepts regex) 🏷️
  • annotation β€” [Key] or [Key=Value] Annotation assigned to a container πŸ“
  • annotation! β€” [Key] or [Key=Value] Annotation NOT assigned to a container πŸ™…β€β™€οΈ
  • label β€” [Key] or [Key=Value] Label assigned to a container πŸŽ€
  • label! β€” [Key] or [Key=Value] Label NOT assigned to a container 🚫
  • exited β€” [Int] Container's exit code πŸ”’
  • status β€” [Status] Container's status: 'created', 'initialized', 'running', 'stopped', 'paused', 'exited', 'removing', 'stopping', 'unknown' 🌈
  • ancestor β€” [ImageName] Image or descendant used to create container (accepts regex) 🧬
  • before β€” [ID] or [Name] Containers created before this container βͺ
  • since β€” [ID] or [Name] Containers created since this container ⏩
  • volume β€” [VolumeName] or [MountpointDestination] Volume mounted in container πŸ’Ύ
  • health β€” [Status] healthy or unhealthy 🩺
  • pod β€” [Pod] name or full or partial ID of pod πŸ«›
  • network β€” [Network] name or full ID of network 🌐
  • restart-policy β€” [Policy] Container's restart policy (e.g., 'no', 'on-failure', 'always', 'unless-stopped') πŸ”„
  • until β€” [DateTime] Containers created before the given duration or time. ⏰
  • command β€” [Command] the command the container is executing, only argv[0] is taken πŸ–₯️
  • should-start-on-boot β€” [Bool] Containers that need to be restarted after system reboot. True for containers with restart policy 'always', or 'unless-stopped' that were not explicitly stopped by the user πŸ”Œ
  • --latest, -l β€” instead of giving a container name or ID, just use the last created container. but bestie, listen: ⚠️ the last started container can be from other users of Podman on the host machine. also, this option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines. πŸ™ˆ
  • --running β€” restart all containers that are already in the running state. only the running girlies. πŸ’ƒ
  • --time, -t=seconds β€” seconds to wait before forcibly stopping the container. use -1 for infinite wait. ⏳

πŸ¦‹ EXAMPLES πŸ¦‹

okay these examples are literally the moment. copy them, run them, slay. πŸ’…

restart the latest container.

$ podman restart -l
ec588fc80b05e19d3006bf2e8aa325f0a2e2ff1f609b7afb39176ca8e3e13467

restart a specific container by partial container ID.

$ podman restart ff6cf1
ff6cf1e5e77e6dba1efc7f3fcdb20e8b89ad8947bc0518be1fcb2c78681f226f

restart two containers by name with a timeout of 4 seconds.

$ podman restart --time 4 test1 test2
c3bb026838c30e5097f079fa365c9a4769d52e1017588278fa00d5c68ebc1502
17e13a63081a995136f907024bcfe50ff532917988a152da229db9d894c5a9ec

restart all running containers.

$ podman restart --running

restart all containers.

$ podman restart --all

restart container using ID specified in a given files.

$ podman restart --cidfile /home/user/cidfile-1
$ podman restart --cidfile /home/user/cidfile-1 --cidfile ./cidfile-2

restart container by name.

$ podman restart --filter name=id-name-test

restart container by label.

$ podman restart --filter label=app=label-test

restart container by exit code.

$ podman restart --filter exited=0

restart container by status.

$ podman restart --filter status=running

restart container by ancestor image.

$ podman restart --filter ancestor=nginx

restart containers created before another.

$ podman restart --filter before=second

restart containers created since another.

$ podman restart --filter since=first

restart container by volume.

$ podman restart --filter volume=vol-filter

restart containers in a pod.

$ podman restart --filter pod=mypod

restart container by network.

$ podman restart --filter network=net-filter

restart containers created until time.

$ podman restart --filter until=10s

πŸ‘€ SEE ALSO πŸ‘€

  • podman(1) β€” the main character. go read it. 🫢

πŸ“œ HISTORY πŸ“œ

March 2018, originally compiled by Matt Heon mheon@redhat.com ⟨mailto:mheon@redhat.com⟩. a legend, fr fr. 🫑


and that's the whole page, bestie!! πŸŽ‰ you're now officially a podman-restart expert. go forth and restart things responsibly. πŸ’œ

podman-restart(1) β€” General Commands Manual β€” source/version podman-restart(1) β€” date March 2018 πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from