Docker debugging a container that stops immediately
⧼vector-jumptonavigation⧽
⧼vector-jumptosearch⧽
es:Docker depurando un contenedor que se detiene inmediatamente
fr:Docker déboguer un conteneur qui se stop immédiatement
This article has been created by an automatic translation software. You can view the article source here.
Introduction
When you start your docker run the container stops immediately, it is possible that your PID 1 did not start, however you do not see anything in the logs and cannot check in your container.
We will see how to debug a Docker container that stops immediately, by forcing a command on it at PID 1.
Course
Restart your docker run with the command below:
$ docker run -d --name NOM_DE_VOTRE_CONTENEUR NOM_DE_VOTRE_IMAGE /bin/sh -c "while true; do sleep 2; df -h; done"
This will make your PID 1 will still be running, so you can check in your container if your services are running and debug them.
Cet article vous a semblé utile ?
0
Enable comment auto-refresher