Skip to content

Instantly share code, notes, and snippets.

@6ui11em
Last active October 6, 2019 22:32
Show Gist options
  • Save 6ui11em/513b91c5579f552d479831abd1ae2b3f to your computer and use it in GitHub Desktop.
Save 6ui11em/513b91c5579f552d479831abd1ae2b3f to your computer and use it in GitHub Desktop.
Docker useful commands #docker #commands #unix
# List all containers
$ docker ps -a
# List started containers
$ docker ps
# List stopped containers
docker ps --filter "status=exited"
# Stop container
docker stop <container_name>
# Start docker compose file
docker-compose up
# Start container
docker start <container_name>
# Stop all runing containers
docker stop $(docker ps -a -q)
# Delete all existing containers
docker rm $(docker ps -a -q)
# Delete all existing images
docker rmi $(docker images -q -a)
# Access to contanier
docker exec -ti <container_name> bash
# Show docker logs
docker logs -f <container_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment