Docker Clean Up

All of my personal service was down last night. After checked up my server status, it seems the VPS’s disk is almost full. As a result I have to clean up my services files.

All the services are manged by docker. So I have clean up Docker space and reclaim disk space on your system, you can use the following steps:

  1. Remove all stopped containers:
1
docker container prune

This command will remove all containers that are not currently running.

  1. Remove all unused images:
1
docker image prune

This command will remove all images that are not being used by any containers.

  1. Remove all unused volumes:
    1
    docker volume prune

This command will remove all volumes that are not associated with any containers.

  1. Remove all unused networks:
    1
    docker network prune

This command will remove all networks that are not being used by any containers.

  1. Optionally, remove all unused build cache:
    1
    docker builder prune

This command will remove all unused build cache, which can consume a significant amount of disk space.

By following these steps, you can clean up Docker space and remove any unused containers, images, volumes, networks, and build cache. This will help reclaim disk space on the system.


Docker Clean Up
http://blog.chivier.site/2024-04-10/3d33ab3b8e8e/
Author
Chivier Humber
Posted on
April 10, 2024
Licensed under