Why docker container keeps on restating

0 votes

I try to launch one centos container using docker compose, but my containers goes in restating state. How can I avoid this?

Apr 22, 2020 in Docker by akhtar
• 38,230 points
1,113 views

1 answer to this question.

0 votes

Hi@akhtar,

Docker containers exit by default if no process is running on them. tail -f is an ongoing process, so it will run indefinitely and prevent the container from stopping. So to avoid this error you can add default entrypoint which will override to keep the container running state.

You can add this below entry in your docker-compose file.

entrypoint: tail -f /dev/null
answered Apr 22, 2020 by MD
• 95,440 points

Related Questions In Docker

0 votes
1 answer
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,220 points

edited Oct 16, 2018 by lina 32,861 views
0 votes
1 answer

Access IP address of Couchbase container on Docker Swarm cluster

The property .NetworkSettings.Ports is a map, not a struct. ...READ MORE

answered Aug 24, 2018 in Docker by Nilesh
• 7,050 points
760 views
+1 vote
7 answers

How to connect to a Docker container running mysql on Windows 10?

Avoid using bind_address in your my.cnf file. I don't ...READ MORE

answered Apr 25, 2019 in Docker by Haseeb
12,053 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,090 points
2,426 views
+1 vote
1 answer

How to write ansible play book to install docker and start docker container with docker image on multiple host machines

Hi@Shashi, You can do this task easily with ...READ MORE

answered Oct 22, 2020 in Docker by MD
• 95,440 points
6,109 views
+4 votes
3 answers

Copying files from host to Docker container

Hi, You can use the docker cp command ...READ MORE

answered Dec 9, 2020 in Docker by MD
• 95,440 points
347,826 views
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