144 lines
3.4 KiB
Groff
144 lines
3.4 KiB
Groff
'\" t
|
|
.nh
|
|
.TH podman-restart 1
|
|
.SH NAME
|
|
podman-restart \- Restart one or more containers
|
|
|
|
.SH SYNOPSIS
|
|
\fBpodman restart\fP [\fIoptions\fP] \fIcontainer\fP ...
|
|
|
|
.PP
|
|
\fBpodman container restart\fP [\fIoptions\fP] \fIcontainer\fP ...
|
|
|
|
.SH DESCRIPTION
|
|
The restart command allows containers to be restarted using their ID or name.
|
|
Running containers are stopped and restarted. Stopped containers are started.
|
|
|
|
.SH OPTIONS
|
|
.SS \fB--all\fP, \fB-a\fP
|
|
Restart all containers regardless of their current state.
|
|
|
|
.SS \fB--cidfile\fP
|
|
Read container ID from the specified file and restart the container. Can be specified multiple times.
|
|
|
|
.SS \fB--filter\fP, \fB-f\fP=\fIfilter\fP
|
|
Filter what containers restart.
|
|
Multiple filters can be given with multiple uses of the --filter flag.
|
|
Filters with the same key work inclusive with the only exception being
|
|
\fBlabel\fR which is exclusive. Filters with different keys always work exclusive.
|
|
|
|
.PP
|
|
Valid filters are listed below:
|
|
|
|
.TS
|
|
allbox;
|
|
l l
|
|
l l .
|
|
\fB\fBFilter\fP\fP \fB\fBDescription\fP\fP
|
|
id T{
|
|
[ID] Container's ID (CID prefix match by default; accepts regex)
|
|
T}
|
|
name T{
|
|
[Name] Container's name (accepts regex)
|
|
T}
|
|
label T{
|
|
[Key] or [Key=Value] Label assigned to a container
|
|
T}
|
|
exited [Int] Container's exit code
|
|
status T{
|
|
[Status] Container's status: 'created', 'initialized', 'exited', 'paused', 'running', 'unknown'
|
|
T}
|
|
ancestor T{
|
|
[ImageName] Image or descendant used to create container
|
|
T}
|
|
before T{
|
|
[ID] or [Name] Containers created before this container
|
|
T}
|
|
since T{
|
|
[ID] or [Name] Containers created since this container
|
|
T}
|
|
volume T{
|
|
[VolumeName] or [MountpointDestination] Volume mounted in container
|
|
T}
|
|
health [Status] healthy or unhealthy
|
|
pod T{
|
|
[Pod] name or full or partial ID of pod
|
|
T}
|
|
network T{
|
|
[Network] name or full ID of network
|
|
T}
|
|
until T{
|
|
[DateTime] Containers created before the given duration or time.
|
|
T}
|
|
command T{
|
|
[Command] the command the container is executing, only argv[0] is taken
|
|
T}
|
|
.TE
|
|
|
|
.SS \fB--latest\fP, \fB-l\fP
|
|
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)
|
|
|
|
.SS \fB--running\fP
|
|
Restart all containers that are already in the \fIrunning\fP state.
|
|
|
|
.SS \fB--time\fP, \fB-t\fP=\fIseconds\fP
|
|
Seconds to wait before forcibly stopping the container.
|
|
Use -1 for infinite wait.
|
|
|
|
.SH EXAMPLES
|
|
Restart the latest container.
|
|
|
|
.EX
|
|
$ podman restart -l
|
|
ec588fc80b05e19d3006bf2e8aa325f0a2e2ff1f609b7afb39176ca8e3e13467
|
|
.EE
|
|
|
|
.PP
|
|
Restart a specific container by partial container ID.
|
|
|
|
.EX
|
|
$ podman restart ff6cf1
|
|
ff6cf1e5e77e6dba1efc7f3fcdb20e8b89ad8947bc0518be1fcb2c78681f226f
|
|
.EE
|
|
|
|
.PP
|
|
Restart two containers by name with a timeout of 4 seconds.
|
|
|
|
.EX
|
|
$ podman restart --time 4 test1 test2
|
|
c3bb026838c30e5097f079fa365c9a4769d52e1017588278fa00d5c68ebc1502
|
|
17e13a63081a995136f907024bcfe50ff532917988a152da229db9d894c5a9ec
|
|
.EE
|
|
|
|
.PP
|
|
Restart all running containers.
|
|
|
|
.EX
|
|
$ podman restart --running
|
|
.EE
|
|
|
|
.PP
|
|
Restart all containers.
|
|
|
|
.EX
|
|
$ podman restart --all
|
|
.EE
|
|
|
|
.PP
|
|
Restart container using ID specified in a given files.
|
|
|
|
.EX
|
|
$ podman restart --cidfile /home/user/cidfile-1
|
|
$ podman restart --cidfile /home/user/cidfile-1 --cidfile ./cidfile-2
|
|
.EE
|
|
|
|
.SH SEE ALSO
|
|
\fBpodman(1)\fP
|
|
|
|
.SH HISTORY
|
|
March 2018, Originally compiled by Matt Heon mheon@redhat.com
|
|
\[la]mailto:mheon@redhat.com\[ra]
|