Skip to content

cleancoderocker/docker-cheatsheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 

Repository files navigation

🐳 Docker Cheat Sheet

Useful Docker commands and snippets

Table of Contents

🐳 Containers

Stop and remove all containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Print out the logs of a container

docker logs <CONTAINER_ID_OR_NAME>
docker logs -f --tail 10 <CONTAINER_ID_OR_NAME>

Bash into a container

docker exec -it <CONTAINER_ID_OR_NAME> bash

🐳 Images

List images starting with a prefix

docker images --filter 'reference=<PREFIX>*'
docker images --filter 'reference=<PREFIX>/*'

🐳 Volumes

List all volumes (including host paths) for a container

docker inspect -f '{{ .Mounts }}' <CONTAINER_ID_OR_NAME>

About

Useful Docker commands and snippets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published