Skip to content

Instantly share code, notes, and snippets.

@juanje
Created Apr 13, 2020
Embed
What would you like to do?
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