Docker Commands List – Cheat Sheet

Spread the love

Short list with commands for docker in Linux. See table. If you need more details or you have suggestion – please add comment)

docker run container_nameRun container
docker run -it container_name shRun container with a shell (sh)
docker run –name name_for_container -p 80:80 container_name
Run container_name with name
docker psShow list only active containers (running)
docker ps -aShow all containers (included stopped)
docker stop container_id_or_nameSend stop signal (SIGTERM) for container, then kill (SIGKILL) after a grafe
docker kill container_id_or_nameSend kill signal (SIGKILL) for container
docker statsShow statistics for all running containers
docker logs container_id_or_name
docker logs container_id_or_name –tail 20

docker logs container_id_or_name –follow

Leave a Reply