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
25 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
• 19,670 points

Related Questions In Docker

0 votes
1 answer

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
546 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
• 39,330 points
361 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,900 points
278 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,520 points
136 views
0 votes
1 answer
0 votes
1 answer

What is a docker file? How do I create a docker image with dockerfile?

 A Dockerfile is a script/text configuration file that contains ...READ MORE

answered Jun 7 in Docker by Sirajul
• 19,670 points
274 views