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,170 points
210 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,060 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 20,096 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,020 points
307 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
9,514 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,100 points
1,039 views
0 votes
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,060 points
474 views
+3 votes
3 answers

Copying files from host to Docker container

For copying the files from the host ...READ MORE

answered Jul 18, 2018 in Docker by sunshine
• 1,280 points
187,689 views