From a89cb73ab3e1ecf2be7c89e4a7c498578eff90e1 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Sun, 3 Jul 2022 09:29:22 -0400 Subject: [PATCH] Use upstream nodejs instead of version for Debian sid sid is a moving target, and a rebuild will frequently change. For example, as of 2022-07, nodejs in sid is 16.x and is built on a different libc. This causes apt to be unable to install it. --- Containerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Containerfile b/Containerfile index 4d167c2..334c170 100644 --- a/Containerfile +++ b/Containerfile @@ -1,11 +1,12 @@ FROM docker.io/library/debian:stable-slim -# We need nodejs 14.x, so from experiment -RUN echo 'deb http://deb.debian.org/debian experimental main contrib' > /etc/apt/sources.list.d/sid.list -RUN echo "Package: *\nPin-Priority: 400\nPin: release a=experimental\n" > /etc/apt/preferences.d/sid.pref -RUN echo "Package: nodejs\nPin-Priority: 500\nPin: release a=experimental\n" > /etc/apt/preferences.d/nodejs_from_sid.pref +# We need nodejs 14.x, we get it from upstream RUN apt-get update -RUN apt-get install -y libssl-dev wget unzip -RUN apt-get install -y -t experimental nodejs +# xz-utils is required for decompressing '.tar.xz' +RUN apt-get install -y libssl-dev wget unzip xz-utils +RUN wget 'https://nodejs.org/download/release/v14.19.3/node-v14.19.3-linux-x64.tar.xz' -O node.tar.xz -q +RUN mkdir -p /usr/local/ +RUN tar -xf /node.tar.xz -C /usr/local/ --strip-components 1 +RUN rm -f /node.tar.xz /usr/local/CHANGELOG.md /usr/local/LICENSE /usr/local/README.md RUN useradd --system foundry --home-dir /var/lib/foundry RUN mkdir -p /var/lib/foundry/vtt RUN mkdir -p /var/lib/foundry/data @@ -15,4 +16,4 @@ RUN unzip /root/foundryvtt.zip RUN rm /root/foundryvtt.zip RUN chown -R foundry: /var/lib/foundry USER foundry -CMD nodejs resources/app/main.js --dataPath=/var/lib/foundry/data +CMD /usr/local/bin/node resources/app/main.js --dataPath=/var/lib/foundry/data