Last active
November 7, 2023 20:39
-
-
Save dejanu/b4e15c76851502660ec1d43d3018b9c0 to your computer and use it in GitHub Desktop.
Manage Docker and Display system-wide information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# containers resource usage | |
docker stats [OPTIONS] [CONTAINER...] | |
docker stats --no-stream | |
# docker stats | |
docker system info | |
# check the container runtime | |
docker system info --format "{{ .DefaultRuntime }}" | |
# check root directory for Docker storage, defaults to /var/lib/docker | |
docker info -f '{{ .DockerRootDir}}' | |
# show docker disk usage | |
docker system df | |
# format output | |
docker ps --format 'table {{.Names}}\t{{.Status}}' | |
# remove stoped containers | |
docker rm $(docker ps -aq) | |
# remove dangling/untagged images and not referenced by a container | |
docker image prune -a | |
# debug Docker with systemctl/service and journalctl | |
systemctl status docker | |
systemctl daemon-reload | |
systemctl start docker | |
service docker restart | |
journalctl -xeu docker.service | |
journalctl -u docker | |
# get events | |
docker events --filter event=restart --since=60m | |
docker events --filter event=restart --since=60m > events.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment