podman-wait(1)

πŸ“¦
version 6.1.4 Β· 6 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– podman-wait(1) β€” General Commands Manual πŸ’–

okay bestie, welcome to podman-wait, straight out of the General Commands Manual. this one is literally the "girl, just wait" command and honestly? she's iconic for it. sit down, grab a boba, let's get into it πŸ§‹βœ¨


✨ NAME ✨

podman-wait β€” wait on one or more containers to stop and print their exit codes


πŸ¦‹ SYNOPSIS πŸ¦‹

podman wait [options] container [...]

podman container wait [options] container [...]

🌸 DESCRIPTION 🌸

So the whole vibe is: waits on one or more containers to stop. You can point at a container by its name or by its ID, either one works, no cap.

Got multiple containers? Podman waits on each one consecutively β€” one after the other, no cutting the line. And once all the conditions are satisfied, the containers' return codes get printed out, separated by newline, in the same order as they were given to the command. Order matters, bestie, we respect the queue. 🫢

An exit code of -1 is emitted for all conditions other than "stopped" and "exited". Just so you know.

🚨 ok important one. When you're waiting for containers with a restart policy of always or on-failure β€” think the ones created by podman kube play β€” those containers may be repeatedly exiting and restarting, possibly with different exit codes every single time. chaotic behavior fr. In that case podman wait will only display and detect the first exit after the wait command was started. she's not keeping up with all that, she logs the first one and moves on πŸ’…

Also: when you run a container with podman run --rm, wait does not wait for the container to be fully removed. If waiting for the removal of a container is the thing you actually want, use --condition=removing. yes really. that's the move. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --condition=state β€” the container state or condition you're waiting for. You can specify this multiple times, and at least one condition must match for the command to return. The supported values are "configured", "created", "exited", "healthy", "initialized", "paused", "removing", "running", "stopped", "stopping", "unhealthy". The default condition is "stopped". pick your fighter ✨
  • --exit-first-match β€” wait for the exit of the first container which matches the conditions, and ignore the other ones. first come, first served, the rest can wait (ironically) πŸ™ˆ
  • --help, -h β€” print usage statement. the classic. the helpful one.
  • --ignore β€” ignore errors when a specified container is missing, and mark its return code as -1. ghosted container? no problem, we pretend it's fine 🫢
  • --interval, -i=duration β€” the time interval to wait before polling for completion. A duration string is a sequence of decimal numbers, each with an optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "Β΅s"), "ms", "s", "m", "h". The time unit defaults to "ms". cute little countdown energy ⏳
  • --latest, -l β€” instead of providing the container name or ID, use the last created container. Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines.)

🌈 EXAMPLES 🌈

Wait for the specified container to exit.

$ podman wait mywebserver
0

Wait for the latest container to exit. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)

$ podman wait --latest
0

Wait for the container to exit, checking every two seconds.

$ podman wait --interval 2s mywebserver
0

Wait for the container by ID. This container exits with error status 1:

$ podman wait 860a4b23
1

Wait for both specified containers to exit.

$ podman wait mywebserver myftpserver
0
125

Wait for the named container to exit, but do not fail if the container does not exist.

$ podman wait --ignore does-not-exist
-1

πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

September 2017, Originally compiled by Brent Baude baude@redhat.com ⟨mailto:bbaude@redhat.com⟩


okay that's the whole page, you ate that πŸ“ go forth and wait on your containers, bestie. this was podman-wait(1) from the General Commands Manual, and if you ever need her again she's right there in your terminal. mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from