github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-wait.1.md.in (about)

     1  % podman-wait 1
     2  
     3  ## NAME
     4  podman\-wait - Wait on one or more containers to stop and print their exit codes
     5  
     6  ## SYNOPSIS
     7  **podman wait** [*options*] *container* [...]
     8  
     9  **podman container wait** [*options*] *container* [...]
    10  
    11  ## DESCRIPTION
    12  Waits on one or more containers to stop.  The container can be referred to by its
    13  name or ID.  In the case of multiple containers, Podman waits on each consecutively.
    14  After all conditions are satisfied, the containers' return codes are printed
    15  separated by newline in the same order as they were given to the command.  An
    16  exit code of -1 is emitted for all conditions other than "stopped" and
    17  "exited".
    18  
    19  NOTE: there is an inherent race condition when waiting for containers with a
    20  restart policy of `always` or `on-failure`, such as those created by `podman
    21  kube play`. Such containers may be repeatedly exiting and restarting, possibly
    22  with different exit codes, but `podman wait` can only display and detect one.
    23  
    24  ## OPTIONS
    25  
    26  #### **--condition**=*state*
    27  Container state or condition to wait for.  Can be specified multiple times where at least one condition must match for the command to return.  Supported values are "configured", "created", "exited", "healthy", "initialized", "paused", "removing", "running", "stopped",  "stopping", "unhealthy".  The default condition is "stopped".
    28  
    29  #### **--help**, **-h**
    30  
    31   Print usage statement
    32  
    33  
    34  #### **--ignore**
    35  Ignore errors when a specified container is missing and mark its return code as -1.
    36  
    37  #### **--interval**, **-i**=*duration*
    38    Time interval to wait before polling for completion. A duration string is a sequence of decimal numbers, each with 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". Time unit defaults to "ms".
    39  
    40  @@option latest
    41  
    42  ## EXAMPLES
    43  
    44  Wait for the specified container to exit.
    45  ```
    46  $ podman wait mywebserver
    47  0
    48  ```
    49  
    50  Wait for the latest container to exit. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
    51  ```
    52  $ podman wait --latest
    53  0
    54  ```
    55  
    56  Wait for the container to exit, checking every two seconds.
    57  ```
    58  $ podman wait --interval 2s mywebserver
    59  0
    60  ```
    61  
    62  Wait for the container by ID. This container exits with error status 1:
    63  ```
    64  $ podman wait 860a4b23
    65  1
    66  ```
    67  
    68  Wait for both specified containers to exit.
    69  ```
    70  $ podman wait mywebserver myftpserver
    71  0
    72  125
    73  ```
    74  
    75  Wait for the named container to exit, but do not fail if the container does not exist.
    76  ```
    77  $ podman wait --ignore does-not-exist
    78  -1
    79  ```
    80  
    81  ## SEE ALSO
    82  **[podman(1)](podman.1.md)**
    83  
    84  ## HISTORY
    85  September 2017, Originally compiled by Brent Baude<bbaude@redhat.com>