What is the process for stopping and restarting a docker container?

0 votes
I need to stop and restart a  docker container as a part of my application, How do i go about doing this?
Jul 3 in Docker by Jenny
• 140 points
50 views

1 answer to this question.

0 votes

If you want to stop a docker container here's the command to do it.

docker container stop CONTAINER_ID

The main process inside the container will receive SIGTERM, and after a grace period, SIGKILL. This will stop a running container.

If you want to restart a Docker container then you need to use the following command

docker container restart CONTAINER_ID

This would restart the container.

answered Jul 3 by Sirajul
• 30,140 points

Related Questions In Docker

0 votes
2 answers

What is the difference between a Docker image and a container?

Here is very basic explanation for image ...READ MORE

answered Sep 4, 2018 in Docker by Damon Salvatore
• 5,510 points
789 views
0 votes
1 answer
0 votes
4 answers

what is network namespace and how we can access network namespace for the container?

Hey @Ali, I'll just combine @Eric, @Jackie ...READ MORE

answered Dec 20, 2018 in Docker by Kalgi
• 41,590 points
474 views
0 votes
1 answer

What is the difference between “expose” and “publish” in Docker?

Basically, you have three options: Neither specify EXPOSE nor -p -> ...READ MORE

answered Jul 18, 2018 in Docker by Nilesh
• 6,880 points
375 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
188 views
+1 vote
1 answer

what is the difference between docker swarm and kubernetes

Both Kubernetes and Docker Swarm are important ...READ MORE

answered Sep 24 in Docker by Sirajul
• 30,140 points
338 views
0 votes
1 answer