Home > Article > Operation and Maintenance > Detailed explanation of how to properly shut down Docker
Docker is an open source software project that helps developers easily package, publish and run applications. However, how do we shut down Docker when we no longer need it? This article will explain in detail how to shut down Docker correctly.
Shutting down Docker from the command line is very simple, just execute the following command:
$ sudo systemctl stop docker
This will stop immediately All running Docker containers and processes. If you want to restart Docker, please use the following command:
$ sudo systemctl start docker
If you want to shut down Docker while using Docker Desktop, Please follow the steps below:
Click the Docker icon on the menu bar and select "Quit Docker Desktop".
Click the Docker icon on the taskbar and select "Quit Docker Desktop".
If neither of the above two methods works, you can try to kill all Docker processes manually. You can get all running Docker processes using the following command:
$ docker container ls
will display some running containers. You can then kill all Docker processes using the following command:
$ docker kill $(docker ps -q)
If you don't need Docker at all, you can choose to uninstall it. You can uninstall Docker using the following command:
$ sudo apt-get purge docker-ce docker-ce-cli containerd.io
$ sudo yum remove docker-ce docker-ce-cli containerd.io
Select the "Uninstall" option of Docker Desktop.
Select the "Uninstall" option of Docker Desktop.
In short, the above are several ways to shut down Docker. Please choose the closing method that suits you according to your actual situation.
The above is the detailed content of Detailed explanation of how to properly shut down Docker. For more information, please follow other related articles on the PHP Chinese website!