Skip to content

Latest commit

History

History
44 lines (32 loc) 路 788 Bytes

File metadata and controls

44 lines (32 loc) 路 788 Bytes

馃惓 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>