Home > Operation and Maintenance > Docker > Detailed explanation of how to properly shut down Docker

Detailed explanation of how to properly shut down Docker

PHPz
Release: 2023-04-17 16:53:00
Original
4462 people have browsed it

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.

  1. Command Line Shutdown Docker

Shutting down Docker from the command line is very simple, just execute the following command:

$ sudo systemctl stop docker
Copy after login

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
Copy after login
  1. Close Docker using Docker Desktop

If you want to shut down Docker while using Docker Desktop, Please follow the steps below:

  • macOS system:

Click the Docker icon on the menu bar and select "Quit Docker Desktop".

  • Windows system:

Click the Docker icon on the taskbar and select "Quit Docker Desktop".

  1. Kill all Docker processes manually

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
Copy after login

will display some running containers. You can then kill all Docker processes using the following command:

$ docker kill $(docker ps -q)
Copy after login
  1. Uninstall Docker

If you don't need Docker at all, you can choose to uninstall it. You can uninstall Docker using the following command:

  • Ubuntu system:
$ sudo apt-get purge docker-ce docker-ce-cli containerd.io
Copy after login
  • CentOS system:
$ sudo yum remove docker-ce docker-ce-cli containerd.io
Copy after login
  • macOS System:

Select the "Uninstall" option of Docker Desktop.

  • Windows system:

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template