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, 2019 in Docker by Jenny
• 140 points
9,337 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, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

0 votes
3 answers

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

Images are read-only templates that contain a ...READ MORE

answered Aug 10, 2020 in Docker by Vishal
• 260 points
6,667 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
• 52,350 points
5,849 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
• 7,060 points
3,275 views
+2 votes
1 answer
+2 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
• 58,020 points
2,715 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, 2019 in Docker by Sirajul
• 59,230 points
2,375 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP