Skip to content

Where a DevOps engineer's disk goes: images, clusters, CLIs and state

Containers, local Kubernetes, infrastructure tools and cloud CLIs each keep data outside any project. A map, what one Mac measured, and what to clear.

6 min read

Infrastructure work fills a disk with other people's software: container images, cluster nodes, provider plugins and command-line tools that each bundle a runtime. Very little of it is in a project folder.

The map

WhatMeasured hereTypicalGuide
Docker images and volumes1.0 GBtens of GBDocker
Local Kubernetesnoneseveral GB per clusterlocal clusters
Terraform providersnonehundreds of MB per projectTerraform
Cloud CLIs1.05 GBabout 1 GBcloud CLIs
Homebrew packages7.0 GBgrows with toolsHomebrew
CI runner cachesnonegrows per jobCI runners
Virtual machinesnone20 GB and up eachvirtual machines

The two that grow unnoticed

  • Docker's disk image only grows. Deleting images inside Docker frees space in the image but the file on your Mac can stay large until Docker compacts it. Pruning, then checking the size of Docker's data folder, is the routine.
  • Terraform provider plugins are downloaded into each project's .terraform folder separately unless a plugin cache is configured. Twenty projects on the AWS provider is twenty copies.
docker system df
du -sh ~/Library/Containers/com.docker.docker 2>/dev/null
find ~ -maxdepth 5 -type d -name .terraform -prune 2>/dev/null | xargs du -sh 2>/dev/null | sort -h | tail
gcloud components list --only-local-state 2>/dev/null

The order to clear

  1. Prune Docker, then remove volumes for stacks you no longer run.
  2. Delete local clusters you are not using; each one is a VM or a container full of images.
  3. Set a Terraform plugin cache and delete old .terraform folders.
  4. Remove cloud CLIs and gcloud components for platforms you no longer touch.

Related: Multipass taking up space on Mac.

Common questions

What takes the most space on a DevOps engineer's Mac?

Docker images and volumes and local Kubernetes clusters, followed by virtual machines, Homebrew tools and cloud CLIs.

Why does Docker's disk image not shrink after pruning?

The image file on your Mac grows as needed but does not always shrink immediately. Pruning frees space inside it, and Docker compacts the file later.

How do I stop Terraform downloading providers for every project?

Set a plugin cache directory with plugin_cache_dir in your Terraform CLI configuration, so projects share one copy.

How big are cloud CLIs on a Mac?

About 1 GB for four of them on the Mac measured, with the Google Cloud SDK the largest at 442 MB.

Read next