3

How to stop docker containers from auto starting

 2 years ago
source link: https://dev.to/faizanarif121/how-to-stop-docker-containers-from-auto-starting-202l
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Faizan Arif

Posted on Oct 30

How to stop docker containers from auto starting

Problem

As a developer, We work on different projects. Some of the projects (having oAuth or constant ports) work on only specific ports. For example, I've a project which always run on 8080. If any other process is using this port, I've to stop that process and then restart the project.
Most of the time, docker containers from other projects run
automatically on these ports after starting the system. So we've to manually shut them down.

Solution

  • We can stop specific container by going to the specific directory and then running the following command
docker-compose down // this will shut down all the containers running in that docker environment
Enter fullscreen modeExit fullscreen mode

Additionally, to prevent a specific container from auto starting when a system is powered on (started), we can run following command

docker update --restart=no [container id] //without square brackets
Enter fullscreen modeExit fullscreen mode

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK