Skip to content

Instantly share code, notes, and snippets.

@juanje
Created April 13, 2020 15:26
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 juanje/dcdbb0569584e6fec30eef5eb6786f98 to your computer and use it in GitHub Desktop.
Save juanje/dcdbb0569584e6fec30eef5eb6786f98 to your computer and use it in GitHub Desktop.
Check what makes your Docker image fat
# The command to see the space used under each directory is `du -sh /*`
# The `2> /dev/null` at the end is to avoid get lost with a lot of minor errors.
# For the example 'mydockerimage' is the name of the Docker image to be checked.
# Another way is to use Dive (https://github.com/wagoodman/dive), a really nice tool for this.
docker run --rm -u root --entrypoint "" mydockerimage du -sh /* 2> /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment