Docker: Add install-nodejs.sh script

This commit is contained in:
Michael Mayer 2022-02-17 13:54:42 +01:00
parent c76d0e27ba
commit c1222b2572
5 changed files with 17 additions and 16 deletions

View file

@ -73,10 +73,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
ffmpegthumbnailer \
libavcodec-extra \
sudo && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \
/root/.local/bin/install-nodejs.sh && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
mkdir -p "/go/src" "/go/bin" && \

View file

@ -86,10 +86,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
chrpath \
lsof \
apache2-utils && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \
/root/.local/bin/install-nodejs.sh && \
/root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \

View file

@ -85,10 +85,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
chrpath \
lsof \
apache2-utils && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \
/root/.local/bin/install-nodejs.sh && \
/root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
apt-get -y autoremove && apt-get -y autoclean && apt-get -y clean && rm -rf /var/lib/apt/lists/* && \

View file

@ -82,10 +82,7 @@ RUN apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-insta
apache2-utils \
fonts-roboto \
sudo && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get update && apt-get -qq install nodejs && \
npm install --unsafe-perm=true --allow-root -g npm && \
npm config set cache ~/.cache/npm && \
/root/.local/bin/install-nodejs.sh && \
/root/.local/bin/install-darktable.sh ${TARGETARCH} && \
/root/.local/bin/install-tensorflow.sh ${TARGETARCH} && \
/root/.local/bin/install-devtools.sh ${TARGETARCH} && \

View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# abort if the user is not root
if [[ $(id -u) != "0" ]]; then
echo "Usage: run install-nodejs.sh as root" 1>&2
exit 1
fi
# install from nodesource.com
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get update && apt-get -qq install nodejs
npm install --unsafe-perm=true --allow-root -g npm
npm config set cache ~/.cache/npm