Skip to content

Commit

Permalink
Make version detection more robust - always use latest LTS, don't rel…
Browse files Browse the repository at this point in the history
…y on the website; instead use nvm directly.
  • Loading branch information
Loki-101 authored Jun 22, 2024
1 parent b2ae4d7 commit 30e4765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | b
&& [ -s $NVM_DIR/nvm.sh ] && \. $NVM_DIR/nvm.sh \
&& echo "nvm_get_arch() { nvm_echo 'x64-musl'; }" >> $NVM_DIR/nvm.sh \
&& source $NVM_DIR/nvm.sh \
&& latest_version=$(curl -s https://unofficial-builds.nodejs.org/download/release/ | grep -o "v${NODE_BASE_VERSION}\.[0-9]*\.[0-9]*" | sort -V | tail -n1) \
&& latest_version=$(nvm ls-remote | grep 'Latest LTS' | awk '{print $1}' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | sort -t. -k1,1nr -k2,2nr -k3,3nr | head -n1) \
&& nvm install $latest_version \
&& npm config set prefix /usr \
&& npm install -g yarn \
Expand Down

0 comments on commit 30e4765

Please sign in to comment.