From 7556e9b547048b47e8357c972a98367edc2f0c2e Mon Sep 17 00:00:00 2001 From: Robert Helewka Date: Sun, 21 Jun 2026 17:58:54 -0400 Subject: [PATCH] build: install Node 24 so JS actions run in the job container When this image is used as a Gitea Actions `container:`, the runner exec's `node` inside it to run JS-based actions (actions/checkout, upload-artifact). The image had no Node, so consuming app builds failed at the checkout step with `exec: "node": executable file not found in $PATH`. Pull Node 24 from NodeSource (Noble's apt nodejs is v18) and assert it in the image sanity check. Co-Authored-By: Claude Opus 4.8 --- Dockerfile | 11 ++++++++++- README.md | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be41c6b..bfa0a69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ curl unzip git ca-certificates && \ rm -rf /var/lib/apt/lists/* +# Node is required for Gitea Actions JS actions (actions/checkout, +# upload-artifact, ...) to run when this image is used as a job container — +# the runner exec's `node` inside the container. Noble's apt nodejs is v18; +# pull the current Node 24 from NodeSource instead. +ARG NODE_MAJOR=24 +RUN curl -fsSL "https://deb.nodesource.com/setup_${NODE_MAJOR}.x" | bash - && \ + apt-get install -y --no-install-recommends nodejs && \ + rm -rf /var/lib/apt/lists/* + # Install the command-line tools into the canonical "latest" location. RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \ curl -fsSL -o /tmp/tools.zip \ @@ -42,7 +51,7 @@ RUN yes | sdkmanager --licenses >/dev/null && \ rm -rf ${ANDROID_SDK_ROOT}/.android # Sanity: fail the image build if the toolchain isn't actually usable. -RUN java -version && sdkmanager --version && \ +RUN java -version && sdkmanager --version && node --version && \ test -d "${ANDROID_SDK_ROOT}/platforms/${PLATFORM_VERSION}" WORKDIR /workspace \ No newline at end of file diff --git a/README.md b/README.md index cf75522..29e1af2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ here — and we don't need one. - Android cmdline-tools, platform, and build-tools — **baked in**, so prod builds don't depend on Google's download endpoint at job time - `git`, `curl`, `unzip` +- Node.js 24 — so Gitea Actions JS actions (`actions/checkout`, + `upload-artifact`, …) run when this image is used as a job `container` Pinned versions live as `ARG`s at the top of the `Dockerfile`: