DEV Community

sot528
sot528

Posted on

5 1

Remove unnecessary Docker resources.

Problem

Using Docker for Mac long time uses large storage spaces.

sot-mbp:clean_docker_resources sot528$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              152                 2                   37.57GB             35.79GB (95%)
Containers          4                   0                   35.8MB              35.8MB (100%)
Local Volumes       4                   0                   7.118MB             7.118MB (100%)
Build Cache         0                   0                   0B                  0B

Solution

docker system prune

Then, SIZE is be around 30GB.
And remove old images without recent 10 images.

docker rmi -f $(docker images | sed -n '10,$p')

Result

Good!

sot-mbp:clean_docker_resources sot528$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              7                   0                   5.337GB             5.337GB (100%)
Containers          0                   0                   0B                  0B
Local Volumes       4                   0                   7.118MB             7.118MB (100%)
Build Cache         0                   0                   0B                  0B

Environment

  • macOS Mojave 10.14.3(18D109)
  • Docker version 18.09.2, build 6247962

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay