Why does a container created with "docker run -d alpine sleep infinity" go into an exit / stop state?

I have nothing to do inside the container, but I want it to work. So, I tried to create a container using the following command line - 'docker run -d alpine sleep infinity' . But instead, it immediately goes into an exit / stop state. What is the explanation?

+7
docker
source share
1 answer

alpine is based on busybox and does not provide the full range of options and extensions available in GNU tools; infinity as an option for sleeping is an example of what is not available.

Consider instead:

 docker run -d alpine sh -c 'while sleep 3600; do :; done' 
+12
source share

All Articles