File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,12 +88,11 @@ RUN ARCH=$(dpkg --print-architecture) \
8888 elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64" ; \
8989 else NODE_ARCH="$ARCH" ; fi \
9090 && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \
91- | grep -oP " node-v\K [0-9]+\. [0-9]+\. [0-9]+(?= -linux-${NODE_ARCH}\. tar\. xz) " \
91+ | sed -nE "s/.* node-v( [0-9]+\. [0-9]+\. [0-9]+) -linux-${NODE_ARCH}\. tar\. xz.*/ \1 /p " \
9292 | head -1) \
93+ && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
9394 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
94- | tar -xJ -C /usr/local --strip-components=1 \
95- && npm install -g npm@latest \
96- && npm cache clean --force
95+ | tar -xJ -C /usr/local --strip-components=1
9796RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
9897
9998COPY --from=builder --chown=1000 /app/.venv /app/.venv
Original file line number Diff line number Diff line change @@ -63,12 +63,11 @@ RUN ARCH=$(dpkg --print-architecture) \
6363 elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64" ; \
6464 else NODE_ARCH="$ARCH" ; fi \
6565 && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \
66- | grep -oP " node-v\K [0-9]+\. [0-9]+\. [0-9]+(?= -linux-${NODE_ARCH}\. tar\. xz) " \
66+ | sed -nE "s/.* node-v( [0-9]+\. [0-9]+\. [0-9]+) -linux-${NODE_ARCH}\. tar\. xz.*/ \1 /p " \
6767 | head -1) \
68+ && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
6869 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
69- | tar -xJ -C /usr/local --strip-components=1 \
70- && npm install -g npm@latest \
71- && npm cache clean --force
70+ | tar -xJ -C /usr/local --strip-components=1
7271
7372# Create non-root user
7473RUN useradd --uid 1000 --gid 0 --no-create-home --home-dir /app/data user
Original file line number Diff line number Diff line change @@ -89,12 +89,11 @@ RUN ARCH=$(dpkg --print-architecture) \
8989 elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64" ; \
9090 else NODE_ARCH="$ARCH" ; fi \
9191 && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \
92- | grep -oP " node-v\K [0-9]+\. [0-9]+\. [0-9]+(?= -linux-${NODE_ARCH}\. tar\. xz) " \
92+ | sed -nE "s/.* node-v( [0-9]+\. [0-9]+\. [0-9]+) -linux-${NODE_ARCH}\. tar\. xz.*/ \1 /p " \
9393 | head -1) \
94+ && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
9495 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
95- | tar -xJ -C /usr/local --strip-components=1 \
96- && npm install -g npm@latest \
97- && npm cache clean --force
96+ | tar -xJ -C /usr/local --strip-components=1
9897RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
9998
10099COPY --from=builder --chown=1000 /app/.venv /app/.venv
Original file line number Diff line number Diff line change @@ -84,12 +84,11 @@ RUN ARCH=$(dpkg --print-architecture) \
8484 elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64" ; \
8585 else NODE_ARCH="$ARCH" ; fi \
8686 && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \
87- | grep -oP " node-v\K [0-9]+\. [0-9]+\. [0-9]+(?= -linux-${NODE_ARCH}\. tar\. xz) " \
87+ | sed -nE "s/.* node-v( [0-9]+\. [0-9]+\. [0-9]+) -linux-${NODE_ARCH}\. tar\. xz.*/ \1 /p " \
8888 | head -1) \
89+ && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
8990 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
90- | tar -xJ -C /usr/local --strip-components=1 \
91- && npm install -g npm@latest \
92- && npm cache clean --force
91+ | tar -xJ -C /usr/local --strip-components=1
9392RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
9493
9594COPY --from=builder --chown=1000 /app/.venv /app/.venv
Original file line number Diff line number Diff line change @@ -85,12 +85,11 @@ RUN ARCH=$(dpkg --print-architecture) \
8585 elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64" ; \
8686 else NODE_ARCH="$ARCH" ; fi \
8787 && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \
88- | grep -oP " node-v\K [0-9]+\. [0-9]+\. [0-9]+(?= -linux-${NODE_ARCH}\. tar\. xz) " \
88+ | sed -nE "s/.* node-v( [0-9]+\. [0-9]+\. [0-9]+) -linux-${NODE_ARCH}\. tar\. xz.*/ \1 /p " \
8989 | head -1) \
90+ && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
9091 && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
91- | tar -xJ -C /usr/local --strip-components=1 \
92- && npm install -g npm@latest \
93- && npm cache clean --force
92+ | tar -xJ -C /usr/local --strip-components=1
9493RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
9594
9695COPY --from=builder --chown=1000 /app/.venv /app/.venv
You can’t perform that action at this time.
0 commit comments