➜ docker system df
➜ docker system df -v
Exemple:
➜ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 110 43 27.76GB 15.49GB (55%)
Containers 61 32 4.747GB 364.8MB (7%)
Local Volumes 1009 8 71.95GB 67.8GB (94%)
Build Cache 0 0 0B 0B
➜ docker system prune
➜ docker system prune -a
➜ docker system prune --volumes
-a
includes unused and dangling containers
--volumes
Volumes are not pruned by default, you must specify
➜ docker image prune
➜ docker image prune -a
➜ docker image prune -a --filter "until=24h"
-a
clean up dangling images only
➜ docker volume prune
➜ docker container prune
➜ docker container prune --filter "until=24h"
➜ docker ps -s --format "table {{.ID}} \t {{.Names}} \t {{.Status}}"
Exemple:
➜ docker ps -s --format "table {{.ID}} \t {{.Names}} \t {{.Status}}"
CONTAINER ID NAMES STATUS
1445fa8911a7 container-php Up 39 seconds
a27893c870a9 container-nodejs Up 35 seconds (healthy)
0a61b789a16c container-maria Up 35 seconds
408a894f85da container-pma Up 39 seconds
➜ docker logs --tail 50 --follow --timestamps [NAME]
➜ docker stats [NAME]
➜ docker inspect [NAME]
➜ docker top [NAME] (processus)
Access to current container
docker exec -it [NAME] bash
OR
docker-compose -f ./docker-compose.yml -f ./docker-compose.main.yml -p [PROJECT] exec --user www-data [NAME] bash
Create a new clone container
docker-compose -f ./docker-compose.yml -f ./docker-compose.main.yml -p [PROJECT] run --user www-data [NAME] bash