Skip to content

Instantly share code, notes, and snippets.

@Dynom
Created January 16, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dynom/a2cc7f0d4938133e8961d00eb22b943e to your computer and use it in GitHub Desktop.
Save Dynom/a2cc7f0d4938133e8961d00eb22b943e to your computer and use it in GitHub Desktop.
Reclaim Docker claimed disk space on macOS
You can reclaim your host's disk-space on macOS in the new Docker 1.13, reducing the file size of the `Docker.qcow2` file.
Steps:
1. du -sh ~/Library/Containers/com.docker.docker/Data (Check current disk usage)
2. docker run --rm -it --privileged --pid=host walkerlee/nsenter -t 1 -m -u -i -n fstrim /var
3. restart docker (starting it might take a while)
4. du -sh ~/Library/Containers/com.docker.docker/Data
Additional:
* Checkout: docker system prune --help
Source:
* https://github.com/djs55/docker.github.io/commit/b9df8fd2040b245537d27930f08ad326598844ce#diff-3c9e26dd35de8ef996a7a91af7240fd2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment