Great news
To make sure you have smaller image, do this for the Rustup step:
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable --profile minimal --target x86_64-unknown-linux-gnu -y
The --profile minimal
part is crucial and it shaved off ~500MB from our Docker image. With the default profile Rust is installed as if itβs on a development machine. The minimal profile is for servers / apps.
The --target x86_64-unknown-linux-gnu
thing you can skip but I prefer to be explicit β 50/50, your call.
More info here: Profiles - The rustup book
4 Likes
I am getting error on the npm install, any idea?
------
> [builder 13/18] RUN cd assets && npm install:
#22 0.629 npm ERR! must provide string spec
#22 0.637
#22 0.637 npm ERR! A complete log of this run can be found in:
#22 0.637 npm ERR! /root/.npm/_logs/2022-09-05T15_26_34_548Z-debug.log
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c cd assets && npm install]: exit code: 1