LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-restart

Restart one or more Docker containers (alias)

TLDR

Restart a container (alias of `docker container restart`)
$ docker restart mycontainer
copy
Restart several containers
$ docker restart container1 container2
copy
Wait longer before SIGKILL
$ docker restart --timeout 30 mycontainer
copy
Send a specific stop signal
$ docker restart --signal SIGINT mycontainer
copy

SYNOPSIS

docker restart [options] container [container...]

DESCRIPTION

docker restart is an alias for docker container restart. It stops each named container and starts it again. The stop step sends `SIGTERM` by default (or --signal, or the container's configured stop signal) and waits for the timeout before sending `SIGKILL`.The default timeout is 10 seconds on Linux unless the container was created with a different stop timeout.

PARAMETERS

-t, --timeout seconds

Seconds to wait after the stop signal before `SIGKILL`. `-1` waits until the container exits.
-s, --signal signal
Signal to send when stopping the container, such as `SIGTERM` or `SIGINT`.

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

SEE ALSO

RESOURCES

Copied to clipboard
Kai