Open cstenglein opened 2 years ago
Thanks.
This should reduce the install time for the image a little bit & reduce the image size.
Can you quantify that? What's the difference in size and build time roughly?
Hi @benma
Can you quantify that? What's the difference in size and build time roughly?
Sure, but it's not perfect since a big part of the image build time are the downloads.
Used time
with 2 builds on my local machine to build the current master vs this branch. Note that this does only the parts of the build.sh
script until docker build
since docker run
won't work without a firmware version.
master old => real 19m18.606s
Size 4.8GB
current branch => real 17m13.468s
Size 4.79GB
So size decrease is negligible, but build time decreased a bit (~10%).
Have you considered moving most steps into a installation script, hence collapsing most of the layers into one?
the BitBoxApp does that:
https://github.com/digitalbitbox/bitbox-wallet-app/blob/master/Dockerfile#L21-L22
Hi @benma Sry for the late answer!
Have you considered moving most steps into a installation script, hence collapsing most of the layers into one?
Cool idea, will try that in the coming days, thanks!
No worries, and thanks! Note that there were a lot of changes to the Dockerfile that were merged already. When you try, make sure to use the latest Dockerfile from master
.
@benma should work now please test :)
squashed the commits as well.
Hi @benma
Thank you for the review! Currently I'm very limited in my time so I'm converting this to a draft and reviewing it at a later time. Hope that's fine.
@cstenglein I had actually already approved your PR, the rest were just small improvements. If you want we can merge it as is and I add these small changes on top. Let me know.
This reduces the layers of the DockerFile from 41 to 28.
First, I merged multiple
apt-get
&pip
installs to one. Currently there are twoapt-get
installs (one with basic tools likewget
& one with the rest).Second, I merged multiple
ENV
&RUN
statements into one but was conservative in that regard to not merge all statements, but just adjacent ones.This should reduce the install time for the image a little bit & reduce the image size.