codegurukool.com · Free coding tutorials & online compiler

Home › Docker Tutorial › Troubleshooting

Troubleshooting

Find out why a container stopped.

If a container exits straight away, run docker ps -a to see its exit code (0 means normal, 1 means an error, 137 means it was killed, often by the memory limit), then read docker logs NAME. Port already in use? Choose another host port, for example -p 8081:80.

Example code

docker ps -a
docker logs broken

Run this code in the online editor

← Docker security basicsClean up →