I am building a docker file and noticed one of the layers (while pushing) is over 1GB.
How can I debug what files exist in a specific layer to find the offending file which I need to add to .dockerignore
?
I am building a docker file and noticed one of the layers (while pushing) is over 1GB.
How can I debug what files exist in a specific layer to find the offending file which I need to add to .dockerignore
?
I think this tool could be helpful https://github.com/wagoodman/dive It allows you to inspect each layer.
You can run the tool also inside docker, mounting the docker sock, if you prefer not to install it.
Example to inspect ubuntu:20.04 image layers and contents: