# Check if docker engine is active and stop or start accordingly
if systemctl is-active --quiet docker; then
sudo systemctl stop docker
else
sudo systemctl start docker
fi
Associated Context | |
---|---|
Type | Code Snippet ( .sh ) |
Associated Tags | Systemctl Stop Docker Start Command Line Interface Linux Commands Containerization Service Windows Management Shell Execution Environment Variables User Interaction (UI) Framework: None systemctl docker start stop |
💡 Smart Description | Stops and starts a Docker container using the systemctl command, starting with docker mode for debugging. Use systemctl commands to stop and start the Docker service on a Linux system. |
🔎 Suggested Searches | How to stop Docker in Linux using systemctl? |
Related Links | https://www.geeksforgeeks.org/ https://www.geeksforgeeks.org/cd-command-in-linux-with-examples/ https://www.geeksforgeeks.org/uname-command-in-linux-with-examples/ https://linuxize.com/post/how-to-remove-docker-images-containers-volumes-and-networks/ https://linuxize.com/post/how-to-install-and-use-docker-compose-on-ubuntu-18-04/ https://docs.docker.com/engine/reference/commandline/restart/ https://docs.docker.com/config/daemon/systemd/ |
Related People | Davide Ladisa |
Sensitive Information | No Sensitive Information Detected |
Shareable Link | https://davideladisa.pieces.cloud/?p=fdba4e9856 |