Skip to content

Instantly share code, notes, and snippets.

@nilreml
Last active April 17, 2024 17:33
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 nilreml/37782a38b2a3b7fedb0df3bd77e2eab8 to your computer and use it in GitHub Desktop.
Save nilreml/37782a38b2a3b7fedb0df3bd77e2eab8 to your computer and use it in GitHub Desktop.
Fast one-liner in current dir:
docker run -v $PWD:$PWD -w $PWD --net=[host|none] image cmd
Verbose docker info:
docker system df -v
Delete all build cache:
docker builder prune -af
Docker cache mounts:
Guide: https://docs.docker.com/build/guide/mounts/#add-a-cache-mount
Syntax: https://docs.docker.com/reference/dockerfile/#run---mounttypecache
Backends: https://docs.docker.com/build/cache/backends
Executive summary:
The docker driver cache uses the same storage driver as used for image layers.
`docker buildx du --verbose` lists build cache, including cache mounts.
`docker buildx prune` cleans up dangling cache.
`sudo apt install docker-buildx` on Ubuntu since it doesn't get installed by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment