Closed snowch closed 4 years ago
Hi @snowch ,
According to my understanding of how Docker works, we indeed should do such a cleanup every time, since it needs to be done in the same RUN
command, else the files stay in the image, hidden.
However we've experimented a couple of times with these cleanups, and could not see any impact on the final image size. Here one of them, where they were added everywhere in our theia-full
image:
https://github.com/theia-ide/theia-apps/pull/372#pullrequestreview-432605505
As best as I can tell, maybe there is some Docker magic at play, maybe an optimisation specific for apt
? Not sure.
You are welcome to improve image size by adding such cleanups in a PR, so long as there is a demonstrable size improvement.
I've switched to the python ide for the moment. Let's close this for now and reopen if I get a chance to look at the full images.
Many thanks!
The apt commands here have a cleanup operation: https://github.com/theia-ide/theia-apps/blob/master/theia-full-docker/Dockerfile#L292-L297
However, there are quite a few separate
RUN ... apt-get update ...
commands. Should a clean up be done after each of them to reduce the size of the layer committed by RUN?