1- ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.0.2
1+ ARG BUILD_FROM
22FROM ${BUILD_FROM}
33
4- # Base image is Alpine (HA add-ons base). It may only provide Node 18.x.
5- # OpenClaw requires Node 20+, so we install a Node 20 musl build directly.
6- ARG NODE_VERSION=22.12.0
4+ # Base image is Debian Bookworm (glibc). This avoids musl-related native module issues
5+ # that occur on Alpine (e.g. clipboard, node-llama-cpp).
76
8- RUN apk add --no-cache \
7+ # Install base packages (without nodejs/npm - we'll get Node 22 from NodeSource)
8+ RUN apt-get update && apt-get install -y --no-install-recommends \
99 bash \
1010 git \
1111 openssh-client \
@@ -14,37 +14,31 @@ RUN apk add --no-cache \
1414 jq \
1515 curl \
1616 tar \
17- xz \
18- libstdc++ \
19- libgcc \
20- libatomic \
17+ xz-utils \
2118 file \
22- pax-utils \
2319 python3 \
2420 nginx \
25- ttyd
26-
27- # Install Node.js 22+ (musl build) from unofficial builds.
28- # Router/base image Alpine may ship an older libstdc++; we pull a newer libstdc++ from edge to satisfy Node's C++ symbols.
29- RUN set -eu; \
30- arch=$(uname -m); \
31- if [ "$arch" != "x86_64" ]; then echo "Unsupported arch: $arch" ; exit 1; fi; \
32- url="https://unofficial-builds.nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64-musl.tar.xz" ; \
33- echo "Downloading Node.js $NODE_VERSION (musl) from $url" ; \
34- curl -fsSL "$url" -o /tmp/node.tar.xz; \
35- mkdir -p /usr/local; \
36- tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \
37- rm -f /tmp/node.tar.xz; \
38- echo "Upgrading libstdc++/libgcc/libatomic from Alpine edge for Node compatibility" ; \
39- apk add --no-cache --upgrade \
40- --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \
41- --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
42- libstdc++ libgcc libatomic; \
43- /usr/local/bin/node -v; /usr/local/bin/npm -v
21+ gnupg \
22+ && apt-get clean \
23+ && rm -rf /var/lib/apt/lists/*
24+
25+ # Install Node.js 22 LTS from NodeSource (Debian Bookworm ships Node 18, but OpenClaw requires 20+)
26+ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
27+ && apt-get install -y nodejs \
28+ && apt-get clean \
29+ && rm -rf /var/lib/apt/lists/*
30+
31+ # Install ttyd (web terminal) - not in Debian repos, download binary
32+ ARG TARGETARCH
33+ RUN ARCH=$(echo ${TARGETARCH:-$(dpkg --print-architecture)} | sed 's/aarch64/arm64/;s/armv7/armhf/;s/amd64/x86_64/' ) \
34+ && curl -fsSL "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${ARCH}" -o /usr/local/bin/ttyd \
35+ && chmod +x /usr/local/bin/ttyd
36+
37+ RUN node -v && npm -v
4438
4539# Install OpenClaw globally
4640RUN npm config set fund false && npm config set audit false \
47- && npm install -g openclaw@2026.1.29
41+ && npm install -g openclaw@2026.1.30
4842
4943COPY run.sh /run.sh
5044COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
0 commit comments