Skip to content

Commit 72f3470

Browse files
committed
fix: install supported npm with Corepack
1 parent e4360a8 commit 72f3470

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docker/build_and_push.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ RUN apt-get update \
3939
&& NODE_VERSION="22.22.2" \
4040
&& curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
4141
| tar -xJ -C /usr/local --strip-components=1 \
42-
&& npm install -g npm@latest \
42+
&& corepack prepare npm@11.18.0 --activate \
43+
&& corepack enable npm \
4344
&& apt-get clean \
4445
&& rm -rf /var/lib/apt/lists/*
4546

@@ -106,7 +107,8 @@ RUN ARCH=$(dpkg --print-architecture) \
106107
&& if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \
107108
&& curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \
108109
| tar -xJ -C /usr/local --strip-components=1 \
109-
&& npm install -g npm@latest
110+
&& corepack prepare npm@11.18.0 --activate \
111+
&& corepack enable npm
110112
RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
111113

112114
COPY --from=builder --chown=1000 /app/.venv /app/.venv

0 commit comments

Comments
 (0)