From 22bc9f7d71d3e2bf2925230c7f3b5f5afb934b5a Mon Sep 17 00:00:00 2001 From: "haidan.xin" Date: Fri, 3 Apr 2026 17:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..45decea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM ghcr.io/openclaw/openclaw:latest + +USER root + +# 安装 tini 进程管理器 +RUN curl -fsSL https://github.com/krallin/tini/releases/download/v0.19.0/tini-static -o /home/node/tini && chmod +x /home/node/tini + +# 安装 skillhub +RUN curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash +RUN cp /root/.local/bin/skillhub /usr/local/bin/skillhub && chmod +x /usr/local/bin/skillhub && mkdir -p /workspace/default && chmod 1777 /workspace/default + +# 创建 gateway-watchdog.sh 守护脚本 +RUN printf '%s\n' \ + '#!/usr/bin/env bash' \ + 'set -euo pipefail' \ + '' \ + 'while true; do' \ + ' echo "Starting gateway..."' \ + ' openclaw gateway --allow-unconfigured' \ + ' EXIT_CODE=$?' \ + ' echo "Gateway exited with code $EXIT_CODE, restarting in 2s..."' \ + ' sleep 2' \ + 'done' > /usr/local/bin/gateway-watchdog.sh && chmod +x /usr/local/bin/gateway-watchdog.sh + +# 替换 SOUL.md 和 IDENTITY.md +COPY rdk-claw/SOUL.md /app/docs/reference/templates/SOUL.md +COPY rdk-claw/IDENTITY.md /app/docs/reference/templates/IDENTITY.md + +# 添加 node-remote-connect skill +COPY rdk-claw/node-remote-connect /app/skills/node-remote-connect + +# 确保权限正确 +RUN chown -R node:node /app/skills/node-remote-connect + +USER node + +ENTRYPOINT ["docker-entrypoint.sh"] +CMD ["/home/node/tini", "--", "/usr/local/bin/gateway-watchdog.sh"] \ No newline at end of file