'\" 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}
label!	T{
[Key] or [Key=Value] Label NOT 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 (accepts regex)
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}
restart-policy	T{
[Policy] Container's restart policy (e.g., 'no', 'on-failure', 'always', 'unless-stopped')
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}
should-start-on-boot	T{
[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
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

.PP
Restart container by name.

.EX
$ podman restart --filter name=id-name-test
.EE

.PP
Restart container by label.

.EX
$ podman restart --filter label=app=label-test
.EE

.PP
Restart container by exit code.

.EX
$ podman restart --filter exited=0
.EE

.PP
Restart container by status.

.EX
$ podman restart --filter status=running
.EE

.PP
Restart container by ancestor image.

.EX
$ podman restart --filter ancestor=nginx
.EE

.PP
Restart containers created before another.

.EX
$ podman restart --filter before=second
.EE

.PP
Restart containers created since another.

.EX
$ podman restart --filter since=first
.EE

.PP
Restart container by volume.

.EX
$ podman restart --filter volume=vol-filter
.EE

.PP
Restart containers in a pod.

.EX
$ podman restart --filter pod=mypod
.EE

.PP
Restart container by network.

.EX
$ podman restart --filter network=net-filter
.EE

.PP
Restart containers created until time.

.EX
$ podman restart --filter until=10s
.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]
