diff --git a/docker/build_and_push.Dockerfile b/docker/build_and_push.Dockerfile index eb4e07d722..e4b6e99a05 100644 --- a/docker/build_and_push.Dockerfile +++ b/docker/build_and_push.Dockerfile @@ -88,12 +88,11 @@ RUN ARCH=$(dpkg --print-architecture) \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ - | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ + | sed -nE "s/.*node-v([0-9]+\.[0-9]+\.[0-9]+)-linux-${NODE_ARCH}\.tar\.xz.*/\1/p" \ | head -1) \ + && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \ && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ - && npm install -g npm@latest \ - && npm cache clean --force + | tar -xJ -C /usr/local --strip-components=1 RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data COPY --from=builder --chown=1000 /app/.venv /app/.venv diff --git a/docker/build_and_push_backend.Dockerfile b/docker/build_and_push_backend.Dockerfile index cab0585456..b233c76aaa 100644 --- a/docker/build_and_push_backend.Dockerfile +++ b/docker/build_and_push_backend.Dockerfile @@ -63,12 +63,11 @@ RUN ARCH=$(dpkg --print-architecture) \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ - | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ + | sed -nE "s/.*node-v([0-9]+\.[0-9]+\.[0-9]+)-linux-${NODE_ARCH}\.tar\.xz.*/\1/p" \ | head -1) \ + && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \ && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ - && npm install -g npm@latest \ - && npm cache clean --force + | tar -xJ -C /usr/local --strip-components=1 # Create non-root user RUN useradd --uid 1000 --gid 0 --no-create-home --home-dir /app/data user diff --git a/docker/build_and_push_base.Dockerfile b/docker/build_and_push_base.Dockerfile index 36dd50c0b7..fea5694a12 100644 --- a/docker/build_and_push_base.Dockerfile +++ b/docker/build_and_push_base.Dockerfile @@ -89,12 +89,11 @@ RUN ARCH=$(dpkg --print-architecture) \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ - | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ + | sed -nE "s/.*node-v([0-9]+\.[0-9]+\.[0-9]+)-linux-${NODE_ARCH}\.tar\.xz.*/\1/p" \ | head -1) \ + && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \ && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ - && npm install -g npm@latest \ - && npm cache clean --force + | tar -xJ -C /usr/local --strip-components=1 RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data COPY --from=builder --chown=1000 /app/.venv /app/.venv diff --git a/docker/build_and_push_ep.Dockerfile b/docker/build_and_push_ep.Dockerfile index 346fded713..183f80cd51 100644 --- a/docker/build_and_push_ep.Dockerfile +++ b/docker/build_and_push_ep.Dockerfile @@ -84,12 +84,11 @@ RUN ARCH=$(dpkg --print-architecture) \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ - | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ + | sed -nE "s/.*node-v([0-9]+\.[0-9]+\.[0-9]+)-linux-${NODE_ARCH}\.tar\.xz.*/\1/p" \ | head -1) \ + && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \ && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ - && npm install -g npm@latest \ - && npm cache clean --force + | tar -xJ -C /usr/local --strip-components=1 RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data COPY --from=builder --chown=1000 /app/.venv /app/.venv diff --git a/docker/build_and_push_with_extras.Dockerfile b/docker/build_and_push_with_extras.Dockerfile index dae3fbd6e4..042c480580 100644 --- a/docker/build_and_push_with_extras.Dockerfile +++ b/docker/build_and_push_with_extras.Dockerfile @@ -85,12 +85,11 @@ RUN ARCH=$(dpkg --print-architecture) \ elif [ "$ARCH" = "arm64" ]; then NODE_ARCH="arm64"; \ else NODE_ARCH="$ARCH"; fi \ && NODE_VERSION=$(curl -fsSL https://nodejs.org/dist/latest-v22.x/ \ - | grep -oP "node-v\K[0-9]+\.[0-9]+\.[0-9]+(?=-linux-${NODE_ARCH}\.tar\.xz)" \ + | sed -nE "s/.*node-v([0-9]+\.[0-9]+\.[0-9]+)-linux-${NODE_ARCH}\.tar\.xz.*/\1/p" \ | head -1) \ + && if [ -z "$NODE_VERSION" ]; then echo "ERROR: Could not determine Node.js version" && exit 1; fi \ && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - | tar -xJ -C /usr/local --strip-components=1 \ - && npm install -g npm@latest \ - && npm cache clean --force + | tar -xJ -C /usr/local --strip-components=1 RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data COPY --from=builder --chown=1000 /app/.venv /app/.venv