You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Got some good feedback (below) about the Dockerfile, in particular around driving the image size down. The current image size of the 0.1.0 release is 283MB, which does seem like a lot. Would be good to get it down somewhere around 40 - 50 MB?
Clean apt-get cache at end of a RUN (all on same line)
Remove any downloads made with a RUN command (all on some line)
I think the big question is did you need ubuntu? If you don't absolutely need ubuntu try to stick to using alpine for your base for custom Linux containers as it's 5mb vs 188mb starting point.
Next like someone else said check if theirs not already an official base you can build off of in this case FROM node would have got you 3/4th of what you wanted then you could have just plugged in chrome and your Ci code
Lastly just search google for smaller docker file sizes theirs a billion pages. It basically comes down to try to keep related tasks on 1 RUN line so they are layered together
Especially if your using aptget yum or apk, that way you can also cleanup the cache of the installers on the same line. The reason for that is once a layer is written it's that size. So you can't apt update on one layer then clean the apt cache on another line as the previous layer already has those files saved and the new layer just has a notation to clear the files but the files are still in the original layer size.
This holds true for downloading Tar extracting and then removing the tar file make sure the remove is done on same line as the download or the tar file will still be in the higher layer.
The text was updated successfully, but these errors were encountered:
Got some good feedback (below) about the Dockerfile, in particular around driving the image size down. The current image size of the 0.1.0 release is 283MB, which does seem like a lot. Would be good to get it down somewhere around 40 - 50 MB?
Take aways are:
RUN
statements to reduce layersapt-get
cache at end of aRUN
(all on same line)RUN
command (all on some line)The text was updated successfully, but these errors were encountered: