Fix HA add-on: install Node.js 20 (musl) instead of Alpine nodejs
This commit is contained in:
+20
-6
@@ -1,17 +1,31 @@
|
|||||||
ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.0.2
|
ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.0.2
|
||||||
FROM ${BUILD_FROM}
|
FROM ${BUILD_FROM}
|
||||||
|
|
||||||
# Base image is Alpine. Install Node.js 20+ + git so we can install clawdbot.
|
# Base image is Alpine (HA add-ons base). It may only provide Node 18.x.
|
||||||
# On HA base images, `nodejs` may be 18.x; use `nodejs-current` for 20+.
|
# Clawdbot requires Node 20+, so we install a Node 20 musl build directly.
|
||||||
|
ARG NODE_VERSION=20.11.1
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
nodejs-current \
|
|
||||||
npm \
|
|
||||||
git \
|
|
||||||
bash \
|
bash \
|
||||||
|
git \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
tzdata \
|
tzdata \
|
||||||
jq
|
jq \
|
||||||
|
curl \
|
||||||
|
tar \
|
||||||
|
xz
|
||||||
|
|
||||||
|
RUN set -euo pipefail; \
|
||||||
|
arch=$(uname -m); \
|
||||||
|
if [ "$arch" != "x86_64" ]; then echo "Unsupported arch: $arch"; exit 1; fi; \
|
||||||
|
url="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.xz"; \
|
||||||
|
echo "Downloading Node.js $NODE_VERSION from $url"; \
|
||||||
|
curl -fsSL "$url" -o /tmp/node.tar.xz; \
|
||||||
|
mkdir -p /usr/local; \
|
||||||
|
tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \
|
||||||
|
rm -f /tmp/node.tar.xz; \
|
||||||
|
node -v; npm -v
|
||||||
|
|
||||||
# Install clawdbot globally
|
# Install clawdbot globally
|
||||||
RUN npm config set fund false && npm config set audit false \
|
RUN npm config set fund false && npm config set audit false \
|
||||||
|
|||||||
Reference in New Issue
Block a user