Closed nkakouros closed 5 years ago
This article opened my eyes: docker-container-will-automatically-stop-after-docker-run-d
Short awnser, there is no foreground process for docker to monitor, then docker will remove it.
Start the container with tail -f /dev/null
, and docker will not remove it.
Somehow i got this same problem with manjaro, Docker version 18.09.6-ce, build 481bc77156
My colleague with ubuntu LTS, does not have this problem.
@nkakouros - @BobVanB is correct, you are trying to start the container with the command /sbin/init
. That command simply stops after it starts because it does not run continuously. You have to start a process that does not die, or monitor /dev/null, or something like that, otherwise the container will stop right away.
I am sorry to bother you with a potential non-issue. I am not so experienced with docker. I use the following commands to start a centos6 container:
My docker version is
Docker version 18.09.2-ce, build 62479626f2
.The container simply exits.
docker logs
returns nothing. Am I doing sth wrong?