.nh .TH podman-rm 1 .SH NAME .PP podman-rm - Remove one or more containers .SH SYNOPSIS .PP \fBpodman rm\fP [\fIoptions\fP] \fIcontainer\fP .PP \fBpodman container rm\fP [\fIoptions\fP] \fIcontainer\fP .SH DESCRIPTION .PP \fBpodman rm\fP will remove one or more containers from the host. The container name or ID can be used. This does not remove images. Running or unusable containers will not be removed without the \fB-f\fP option. .SH OPTIONS .SS \fB--all\fP, \fB-a\fP .PP Remove all containers. Can be used in conjunction with \fB-f\fP as well. .SS \fB--cidfile\fP=\fIfile\fP .PP Read container ID from the specified \fIfile\fP and rm the container. Can be specified multiple times. .SS \fB--depend\fP .PP Remove selected container and recursively remove all containers that depend on it. .SS \fB--filter\fP=\fIfilter\fP .PP Filter what containers remove. Multiple filters can be given with multiple uses of the --filter flag. Filters with the same key work inclusive with the only exception being \fB\fClabel\fR which is exclusive. Filters with different keys always work exclusive. .PP Valid filters are listed below: .TS allbox; l l l l . \fB\fC\fBFilter\fP\fR \fB\fC\fBDescription\fP\fR id T{ [ID] Container's ID (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', '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} .TE .SS \fB--force\fP, \fB-f\fP .PP Force the removal of running and paused containers. Forcing a container removal also removes containers from container storage even if the container is not known to podman. Containers could have been created by a different container engine. In addition, forcing can be used to remove unusable containers, e.g. containers whose OCI runtime has become unavailable. .SS \fB--ignore\fP, \fB-i\fP .PP Ignore errors when specified containers are not in the container store. A user might have decided to manually remove a container which would lead to a failure during the ExecStop directive of a systemd service referencing that container. .SS \fB--latest\fP, \fB-l\fP .PP Instead of providing the container name or ID, use the last created container. If you use methods other than Podman to run containers such as CRI-O, the last started container could be from either of those methods. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines) .SS \fB--time\fP, \fB-t\fP=\fIseconds\fP .PP Seconds to wait before forcibly stopping the container. .PP The --force option must be specified to use the --time option. .SS \fB--volumes\fP, \fB-v\fP .PP Remove anonymous volumes associated with the container. This does not include named volumes created with \fBpodman volume create\fP, or the \fB--volume\fP option of \fBpodman run\fP and \fBpodman create\fP\&. .SH EXAMPLE .PP Remove container with a given name .PP .RS .nf $ podman rm mywebserver .fi .RE .PP Remove container with a given name and all of the containers that depend on it .PP .RS .nf $ podman rm --depend mywebserver .fi .RE .PP Remove multiple containers with given names or IDs .PP .RS .nf $ podman rm mywebserver myflaskserver 860a4b23 .fi .RE .PP Remove multiple containers with IDs read from files .PP .RS .nf $ podman rm --cidfile ./cidfile-1 --cidfile /home/user/cidfile-2 .fi .RE .PP Forcibly remove container with a given ID .PP .RS .nf $ podman rm -f 860a4b23 .fi .RE .PP Remove all containers regardless of the run state .PP .RS .nf $ podman rm -f -a .fi .RE .PP Forcibly remove the last created container .PP .RS .nf $ podman rm -f --latest .fi .RE .SH Exit Status .PP \fB0\fP All specified containers removed .PP \fB1\fP One of the specified containers did not exist, and no other failures .PP \fB2\fP One of the specified containers is paused or running .PP \fB125\fP The command fails for any other reason .SH SEE ALSO .PP \fBpodman(1)\fP, \fBcrio(8)\fP .SH HISTORY .PP August 2017, Originally compiled by Ryan Cole rycole@redhat.com \[la]mailto:rycole@redhat.com\[ra]