From 7ca5ed1a16c1bd1ddb2c974c66aa68159c210833 Mon Sep 17 00:00:00 2001 From: "Michael (Parker) Parker" Date: Fri, 11 Apr 2025 12:47:17 -0400 Subject: [PATCH] Update nodejs yolks (#295) * Update nodejs yolks Move user creation and env to not rebuild on every update if not needed. update apt install command to new format update npm install command to properly be global to resolve ts-node issue update npm install commands to install latest version available for node version * fix build moves section that sets the user and env vars to the bottom again. I forgot the order of ops matters. * fix issues with corepack npm doesn't install a working version of corepack unless it's tagged to latest. --- nodejs/12/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/14/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/16/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/17/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/18/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/19/Dockerfile | 33 ++++++++++++++++++++++++++------- nodejs/20/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/21/Dockerfile | 33 ++++++++++++++++++++++++++------- nodejs/22/Dockerfile | 31 +++++++++++++++++++++++++------ nodejs/23/Dockerfile | 31 +++++++++++++++++++++++++------ 10 files changed, 252 insertions(+), 62 deletions(-) diff --git a/nodejs/12/Dockerfile b/nodejs/12/Dockerfile index 348c9fd..e287d9d 100644 --- a/nodejs/12/Dockerfile +++ b/nodejs/12/Dockerfile @@ -2,18 +2,37 @@ FROM --platform=$TARGETOS/$TARGETARCH node:12-bullseye-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@latest typescript ts-node @types/node USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/14/Dockerfile b/nodejs/14/Dockerfile index c0d53ee..89a68be 100644 --- a/nodejs/14/Dockerfile +++ b/nodejs/14/Dockerfile @@ -2,18 +2,37 @@ FROM --platform=$TARGETOS/$TARGETARCH node:14-bullseye-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@latest typescript ts-node @types/node USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/16/Dockerfile b/nodejs/16/Dockerfile index ba417f9..0442061 100644 --- a/nodejs/16/Dockerfile +++ b/nodejs/16/Dockerfile @@ -2,18 +2,37 @@ FROM --platform=$TARGETOS/$TARGETARCH node:16-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@9.x.x typescript ts-node @types/node USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/17/Dockerfile b/nodejs/17/Dockerfile index e10a474..ec32500 100644 --- a/nodejs/17/Dockerfile +++ b/nodejs/17/Dockerfile @@ -2,18 +2,37 @@ FROM --platform=$TARGETOS/$TARGETARCH node:17-bullseye-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@8.11.0 typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@8.x.x typescript ts-node @types/node USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/18/Dockerfile b/nodejs/18/Dockerfile index ee3e920..99deee9 100644 --- a/nodejs/18/Dockerfile +++ b/nodejs/18/Dockerfile @@ -2,11 +2,32 @@ FROM --platform=$TARGETOS/$TARGETARCH node:18-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@10.x.x typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@10.x.x typescript ts-node @types/node # install pnpm RUN npm install -g corepack @@ -17,8 +38,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/19/Dockerfile b/nodejs/19/Dockerfile index c3f3b9d..3b7786e 100644 --- a/nodejs/19/Dockerfile +++ b/nodejs/19/Dockerfile @@ -2,11 +2,32 @@ FROM --platform=$TARGETOS/$TARGETARCH node:19-bullseye-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@9.8.1 typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@9.x.x typescript ts-node @types/node # install pnpm RUN npm install -g corepack @@ -17,9 +38,7 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] CMD ["/entrypoint.sh"] diff --git a/nodejs/20/Dockerfile b/nodejs/20/Dockerfile index 691e8b2..7e71368 100644 --- a/nodejs/20/Dockerfile +++ b/nodejs/20/Dockerfile @@ -2,11 +2,32 @@ FROM --platform=$TARGETOS/$TARGETARCH node:20-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@latest typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@latest typescript ts-node @types/node # install pnpm RUN npm install -g corepack @@ -17,8 +38,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/21/Dockerfile b/nodejs/21/Dockerfile index fd28e79..72821e6 100644 --- a/nodejs/21/Dockerfile +++ b/nodejs/21/Dockerfile @@ -2,14 +2,35 @@ FROM --platform=$TARGETOS/$TARGETARCH node:21-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@10.x.x typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@10.x.x typescript ts-node @types/node # install pnpm -RUN npm install -g corepack +RUN npm install -g corepack@latest RUN corepack enable RUN corepack prepare pnpm@latest --activate @@ -17,8 +38,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/22/Dockerfile b/nodejs/22/Dockerfile index 0ae0985..3378b74 100644 --- a/nodejs/22/Dockerfile +++ b/nodejs/22/Dockerfile @@ -2,11 +2,32 @@ FROM --platform=$TARGETOS/$TARGETARCH node:22-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT - RUN npm install npm@latest typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@latest typescript ts-node @types/node # install pnpm RUN npm install -g corepack @@ -17,8 +38,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"] diff --git a/nodejs/23/Dockerfile b/nodejs/23/Dockerfile index 5cb4278..a02b50e 100644 --- a/nodejs/23/Dockerfile +++ b/nodejs/23/Dockerfile @@ -2,11 +2,32 @@ FROM --platform=$TARGETOS/$TARGETARCH node:23-bookworm-slim LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" -RUN apt update \ - && apt -y install ffmpeg iproute2 git sqlite3 libsqlite3-dev python3 python3-dev ca-certificates dnsutils tzdata zip tar curl build-essential libtool iputils-ping libnss3 tini \ - && useradd -m -d /home/container container +# add container user and set stop signal +RUN useradd -m -d /home/container container +STOPSIGNAL SIGINT -RUN npm install npm@latest typescript ts-node @types/node --location=global +RUN apt update \ + && apt -y install \ + ffmpeg \ + iproute2 \ + git \ + sqlite3 \ + libsqlite3-dev \ + python3 \ + python3-dev \ + ca-certificates \ + dnsutils \ + tzdata \ + zip \ + tar \ + curl \ + build-essential \ + libtool \ + iputils-ping \ + libnss3 \ + tini + +RUN npm install --global npm@latest typescript ts-node @types/node # install pnpm RUN npm install -g corepack @@ -17,8 +38,6 @@ USER container ENV USER=container HOME=/home/container WORKDIR /home/container -STOPSIGNAL SIGINT - COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/usr/bin/tini", "-g", "--"]