Skip to content

Commit ec64469

Browse files
feat: update openclaw action
1 parent 681b499 commit ec64469

3 files changed

Lines changed: 66 additions & 60 deletions

File tree

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: Build Moltbot Image
1+
name: Build OpenClaw Image
22

33
on:
44
push:
55
tags:
66
- "v*"
77
workflow_dispatch:
88
inputs:
9-
moltbotTag:
10-
description: "Moltbot Release Tag"
9+
openclawTag:
10+
description: "OpenClaw Release Tag"
1111
required: true
1212
platforms:
1313
description: "Platforms"
@@ -40,8 +40,8 @@ jobs:
4040
- name: Resolve Tag
4141
id: tag
4242
run: |
43-
if [ -n "${{ github.event.inputs.moltbotTag }}" ]; then
44-
raw_tag="${{ github.event.inputs.moltbotTag }}"
43+
if [ -n "${{ github.event.inputs.openclawTag }}" ]; then
44+
raw_tag="${{ github.event.inputs.openclawTag }}"
4545
else
4646
raw_tag="${GITHUB_REF_NAME}"
4747
fi
@@ -52,31 +52,31 @@ jobs:
5252
- name: Download Source
5353
run: |
5454
set -euo pipefail
55-
mkdir -p _src/moltbot
56-
curl -fsSL "https://github.com/moltbot/moltbot/archive/refs/tags/${{ steps.tag.outputs.value }}.tar.gz" \
57-
| tar -xz -C _src/moltbot --strip-components=1
55+
mkdir -p _src/openclaw
56+
curl -fsSL "https://github.com/openclaw/openclaw/archive/refs/tags/${{ steps.tag.outputs.value }}.tar.gz" \
57+
| tar -xz -C _src/openclaw --strip-components=1
5858
59-
- name: Build Moltbot Image and Push
59+
- name: Build OpenClaw Image and Push
6060
uses: docker/build-push-action@v5
6161
with:
62-
context: _src/moltbot
63-
file: moltbot/Dockerfile
62+
context: _src/openclaw
63+
file: openclaw/Dockerfile
6464
platforms: ${{ github.event.inputs.platforms || 'linux/amd64,linux/arm64/v8' }}
6565
push: true
6666
tags: |
67-
1panel/moltbot:${{ steps.tag.outputs.clean }}
67+
1panel/openclaw:${{ steps.tag.outputs.clean }}
6868
cache-from: type=gha
6969
cache-to: type=gha,mode=max
7070

7171
- name: Push Latest Tag
7272
if: ${{ github.event_name == 'push' || github.event.inputs.pushLatest == 'true' }}
7373
uses: docker/build-push-action@v5
7474
with:
75-
context: _src/moltbot
76-
file: moltbot/Dockerfile
75+
context: _src/openclaw
76+
file: openclaw/Dockerfile
7777
platforms: ${{ github.event.inputs.platforms || 'linux/amd64,linux/arm64/v8' }}
7878
push: true
7979
tags: |
80-
1panel/moltbot:latest
80+
1panel/openclaw:latest
8181
cache-from: type=gha
8282
cache-to: type=gha,mode=max

moltbot/Dockerfile

Lines changed: 0 additions & 45 deletions
This file was deleted.

openclaw/Dockerfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM node:22-bookworm
2+
3+
# Install Bun (required for build scripts)
4+
RUN curl -fsSL https://bun.sh/install | bash
5+
ENV PATH="/root/.bun/bin:${PATH}"
6+
7+
RUN corepack enable
8+
9+
WORKDIR /app
10+
11+
ARG OPENCLAW_DOCKER_APT_PACKAGES=""
12+
RUN if [ -n "$OPENCLAW_DOCKER_APT_PACKAGES" ]; then \
13+
apt-get update && \
14+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $OPENCLAW_DOCKER_APT_PACKAGES && \
15+
apt-get clean && \
16+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
17+
fi
18+
19+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
20+
COPY ui/package.json ./ui/package.json
21+
COPY patches ./patches
22+
COPY scripts ./scripts
23+
24+
RUN pnpm install --frozen-lockfile
25+
26+
COPY . .
27+
RUN OPENCLAW_A2UI_SKIP_MISSING=1 pnpm build
28+
# Force pnpm for UI build (Bun may fail on ARM/Synology architectures)
29+
ENV OPENCLAW_PREFER_PNPM=1
30+
RUN pnpm ui:build
31+
32+
ENV NODE_ENV=production
33+
34+
# ---- add openclaw command ----
35+
# Makes `openclaw ...` == `node /app/dist/index.js ...`
36+
RUN printf '%s\n' \
37+
'#!/bin/sh' \
38+
'set -e' \
39+
'exec node /app/dist/index.js "$@"' \
40+
> /usr/local/bin/openclaw \
41+
&& chmod +x /usr/local/bin/openclaw
42+
# -----------------------------
43+
44+
# Allow non-root user to write temp files during runtime/tests.
45+
RUN chown -R node:node /app
46+
47+
# Security hardening: Run as non-root user
48+
USER node
49+
50+
# Start gateway server with default config.
51+
CMD ["openclaw", "gateway", "--allow-unconfigured"]

0 commit comments

Comments
 (0)