From 571ee3d5fb7af070ae722ff8a1fafe6ba16aedb6 Mon Sep 17 00:00:00 2001 From: David GAILLETON Date: Fri, 2 Oct 2026 17:10:58 +0200 Subject: [PATCH] Add Dockerfile --- Dockerfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d79a6e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Extends the official OpenClaw image with what Homebrew needs. +# Brew itself is installed into the mounted volume on first start (see brew-entrypoint.sh), +# so brew and everything it installs survive image updates. + +ARG OPENCLAW_VERSION=latest +# Check docs.openclaw.ai/install/docker for the exact official image name. +FROM ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION} + +USER root +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential procps curl file git ca-certificates \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /home/linuxbrew/.linuxbrew \ + && chown -R node:node /home/linuxbrew + +COPY --chmod=755 brew-entrypoint.sh /usr/local/bin/brew-entrypoint.sh + +USER node +ENV HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew \ + HOMEBREW_NO_AUTO_UPDATE=1 \ + HOMEBREW_NO_ANALYTICS=1 \ + PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH} + +# Setting ENTRYPOINT resets the base image's CMD, so you must restore it. +# Find the originals with: +# docker inspect --format '{{json .Config.Entrypoint}} {{json .Config.Cmd}}' +# If the base image has its own ENTRYPOINT, add it after brew-entrypoint.sh in the list below. +ENTRYPOINT ["/usr/local/bin/brew-entrypoint.sh"] +CMD ["sh", "brew_entrypoint.sh"] +ENTRYPOINT ["tini", "-s", "--", "node", "/app/docker-entrypoint.mjs"] +CMD ["node", "openclaw.mjs", "gateway"] \ No newline at end of file