Docker Size Investigation
This is a time when you Docker size is BIG!
Then we need to see inside.
Start your CLI inside the Docker
docker run -it --entrypoint /bin/sh <your_container_name>
It is important to skip
entrypointthat will sometimes break the
runif you not yet inject any environment.
Investigate space with command
du -sch *
to see the summary of the result
Then the hidden files
du -sh .[^.]*
Here we have unnecessary
.git folder and also
Now we can have some common mistake list:
- Include files that need to be ignore
- Include source code not only
- Include development file e.g. VSCode, Patch
If you do some of this, size can be reduce by about 25% or even half.
Hope this helps