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 in Docker by akhtar
• 24,570 points
124 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 by MD
• 55,020 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 15,520 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
• 6,980 points
238 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
8,020 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
• 57,640 points
760 views
0 votes
1 answer

How can I install systemctl tool in Docker container?

Hi@akhtar, In docker container if you want to ...READ MORE

answered Feb 5 in Docker by MD
• 55,020 points
2,861 views
0 votes
1 answer

run script shell inside docker app and mongodb container not working?

Hi, I think this error occurs because you ...READ MORE

answered Mar 9 in Docker by MD
• 55,020 points
1,082 views