Fix OpenClaw install: force-skip optional deps (no native builds); bump add-on to 0.5.18

This commit is contained in:
root
2026-02-01 03:10:32 +02:00
parent 5d707fab62
commit 32d4536b44
2 changed files with 7 additions and 13 deletions
+6 -12
View File
@@ -5,11 +5,7 @@ FROM ${BUILD_FROM}
# OpenClaw requires Node 20+, so we install a Node 20 musl build directly. # OpenClaw requires Node 20+, so we install a Node 20 musl build directly.
ARG NODE_VERSION=22.12.0 ARG NODE_VERSION=22.12.0
# NOTE: HA add-on base images sometimes ship with a limited /etc/apk/repositories.
# We explicitly enable Alpine main+community to ensure cmake/build-base are available.
RUN apk add --no-cache \ RUN apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/v3.18/main \
--repository=https://dl-cdn.alpinelinux.org/alpine/v3.18/community \
bash \ bash \
git \ git \
openssh-client \ openssh-client \
@@ -26,10 +22,7 @@ RUN apk add --no-cache \
pax-utils \ pax-utils \
python3 \ python3 \
nginx \ nginx \
ttyd \ ttyd
# Build tools (needed for native deps like node-llama-cpp on Alpine/musl)
build-base \
cmake
# Install Node.js 22+ (musl build) from unofficial builds. # Install Node.js 22+ (musl build) from unofficial builds.
# Router/base image Alpine may ship an older libstdc++; we pull a newer libstdc++ from edge to satisfy Node's C++ symbols. # Router/base image Alpine may ship an older libstdc++; we pull a newer libstdc++ from edge to satisfy Node's C++ symbols.
@@ -50,12 +43,13 @@ RUN set -eu; \
/usr/local/bin/node -v; /usr/local/bin/npm -v /usr/local/bin/node -v; /usr/local/bin/npm -v
# Install OpenClaw globally # Install OpenClaw globally
# NOTE: On Alpine/musl, optional native deps may still attempt to build. # IMPORTANT: OpenClaw declares some native packages as optionalDependencies.
# We include build tools above to avoid install-time failures. # On HAOS/Alpine we want to skip them to avoid install-time native builds.
RUN npm config set fund false && npm config set audit false \ RUN npm config set fund false && npm config set audit false \
&& npm config set optional false \
&& npm config set omit optional \ && npm config set omit optional \
&& npm install -g xpm@0.16.3 \ && NPM_CONFIG_OPTIONAL=false NPM_CONFIG_OMIT=optional \
&& NPM_CONFIG_OMIT=optional npm install -g --omit=optional openclaw@2026.1.30 npm install -g --omit=optional --no-optional openclaw@2026.1.30
COPY run.sh /run.sh COPY run.sh /run.sh
COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl COPY nginx.conf.tpl /etc/nginx/nginx.conf.tpl
+1 -1
View File
@@ -1,5 +1,5 @@
name: OpenClaw Assistant name: OpenClaw Assistant
version: "0.5.17" version: "0.5.18"
slug: openclaw_assistant slug: openclaw_assistant
description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on. description: Run OpenClaw Assistant (OpenClaw-compatible) as a Home Assistant add-on.
url: https://github.com/techartdev/OpenClawHomeAssistant url: https://github.com/techartdev/OpenClawHomeAssistant