LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-container-rm

remove one or more containers

TLDR

Remove a container
$ docker container rm [container]
copy
Remove multiple containers
$ docker container rm [container1] [container2]
copy
Force remove running container
$ docker container rm -f [container]
copy
Remove container and volumes
$ docker container rm -v [container]
copy
Remove all stopped containers
$ docker container rm $(docker container ls -aq -f status=exited)
copy

SYNOPSIS

docker container rm [options] container [container...]

DESCRIPTION

docker container rm removes one or more containers from the Docker host, freeing disk space occupied by the container's read-write layer and metadata. Containers must be stopped before removal unless the -f flag is used to force removal of running containers.The -v option also removes anonymous volumes associated with the container, which is useful for complete cleanup. Named volumes are preserved by default to prevent accidental data loss.The shorthand docker rm is equivalent to docker container rm.

PARAMETERS

-f, --force

Force the removal of a running container (uses SIGKILL).
-v, --volumes
Remove anonymous volumes.
-l, --link
Remove the specified inter-container network link rather than the container itself.

INSTALL

sudo apt install docker-cli
copy
sudo dnf install docker-cli
copy
sudo pacman -S docker
copy
sudo apk add docker-cli
copy
sudo zypper install docker
copy
brew install docker
copy
nix profile install nixpkgs#docker
copy

CAVEATS

Forcing removal of a running container with -f sends SIGKILL without giving the process a chance to clean up. To prune all stopped containers in one step use docker container prune.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid