Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ on:
- 'Dockerfile'
- 'Dockerfile.alpine'
- 'OPENCLAW_VERSION'
- 'scripts/install-openclaw.sh'
- '.github/workflows/docker-release.yml'
pull_request:
branches:
- main
paths:
- 'Dockerfile'
- 'Dockerfile.alpine'
- 'scripts/install-openclaw.sh'
- '.github/workflows/docker-release.yml'
workflow_dispatch:

Expand Down
24 changes: 2 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,8 @@ RUN apt-get update && apt-get install -y \
WORKDIR /build

COPY OPENCLAW_VERSION /tmp/OPENCLAW_VERSION
COPY scripts/install-openclaw.sh /usr/local/bin/install-openclaw

# Install openclaw globally, and backfill Control UI assets if upstream npm
# package omitted dist/control-ui for this version.
RUN set -eux; \
OPENCLAW_VERSION="$(tr -d '[:space:]' < /tmp/OPENCLAW_VERSION)"; \
npm install -g "openclaw@${OPENCLAW_VERSION}"; \
OPENCLAW_ROOT="$(npm root -g)/openclaw"; \
CONTROL_UI_INDEX="${OPENCLAW_ROOT}/dist/control-ui/index.html"; \
if [ ! -f "${CONTROL_UI_INDEX}" ]; then \
echo "Control UI assets missing in openclaw@${OPENCLAW_VERSION}; building from source tag."; \
corepack enable; \
corepack prepare pnpm@10.23.0 --activate; \
rm -rf /tmp/openclaw-src; \
if ! git clone --depth 1 --branch "v${OPENCLAW_VERSION}" https://github.com/openclaw/openclaw.git /tmp/openclaw-src; then \
git clone --depth 1 --branch "v${OPENCLAW_VERSION}-1" https://github.com/openclaw/openclaw.git /tmp/openclaw-src; \
fi; \
cd /tmp/openclaw-src; \
CI=true pnpm --dir ui install --prod=false; \
pnpm --dir ui build; \
mkdir -p "${OPENCLAW_ROOT}/dist"; \
rm -rf "${OPENCLAW_ROOT}/dist/control-ui"; \
cp -R dist/control-ui "${OPENCLAW_ROOT}/dist/control-ui"; \
test -f "${CONTROL_UI_INDEX}"; \
rm -rf /tmp/openclaw-src /root/.local/share/pnpm /root/.cache/pnpm /root/.cache/node/corepack; \
fi
RUN sh /usr/local/bin/install-openclaw
24 changes: 2 additions & 22 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,8 @@ RUN apk add --no-cache \
WORKDIR /build

COPY OPENCLAW_VERSION /tmp/OPENCLAW_VERSION
COPY scripts/install-openclaw.sh /usr/local/bin/install-openclaw

# Install openclaw globally, and backfill Control UI assets if upstream npm
# package omitted dist/control-ui for this version.
RUN set -eux; \
OPENCLAW_VERSION="$(tr -d '[:space:]' < /tmp/OPENCLAW_VERSION)"; \
npm install -g "openclaw@${OPENCLAW_VERSION}"; \
OPENCLAW_ROOT="$(npm root -g)/openclaw"; \
CONTROL_UI_INDEX="${OPENCLAW_ROOT}/dist/control-ui/index.html"; \
if [ ! -f "${CONTROL_UI_INDEX}" ]; then \
echo "Control UI assets missing in openclaw@${OPENCLAW_VERSION}; building from source tag."; \
corepack enable; \
corepack prepare pnpm@10.23.0 --activate; \
rm -rf /tmp/openclaw-src; \
if ! git clone --depth 1 --branch "v${OPENCLAW_VERSION}" https://github.com/openclaw/openclaw.git /tmp/openclaw-src; then \
git clone --depth 1 --branch "v${OPENCLAW_VERSION}-1" https://github.com/openclaw/openclaw.git /tmp/openclaw-src; \
fi; \
cd /tmp/openclaw-src; \
CI=true pnpm --dir ui install --prod=false; \
pnpm --dir ui build; \
mkdir -p "${OPENCLAW_ROOT}/dist"; \
rm -rf "${OPENCLAW_ROOT}/dist/control-ui"; \
cp -R dist/control-ui "${OPENCLAW_ROOT}/dist/control-ui"; \
test -f "${CONTROL_UI_INDEX}"; \
rm -rf /tmp/openclaw-src /root/.local/share/pnpm /root/.cache/pnpm /root/.cache/node/corepack; \
fi
RUN sh /usr/local/bin/install-openclaw
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ The main files to edit are:
- `OPENCLAW_VERSION` (single source of truth for the openclaw npm version)
- `Dockerfile`
- `Dockerfile.alpine`
- `scripts/install-openclaw.sh` (shared openclaw install and Control UI backfill logic)

Common changes include:
- Bumping the `OPENCLAW_VERSION` to a newer npm release
Expand Down
27 changes: 27 additions & 0 deletions scripts/install-openclaw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -eux

OPENCLAW_VERSION="$(tr -d '[:space:]' < /tmp/OPENCLAW_VERSION)"
npm install -g "openclaw@${OPENCLAW_VERSION}"

OPENCLAW_ROOT="$(npm root -g)/openclaw"
CONTROL_UI_INDEX="${OPENCLAW_ROOT}/dist/control-ui/index.html"

if [ ! -f "${CONTROL_UI_INDEX}" ]; then
echo "Control UI assets missing in openclaw@${OPENCLAW_VERSION}; building from source tag."
corepack enable
corepack prepare pnpm@10.23.0 --activate
rm -rf /tmp/openclaw-src
if ! git clone --depth 1 --branch "v${OPENCLAW_VERSION}" https://github.com/openclaw/openclaw.git /tmp/openclaw-src; then
git clone --depth 1 --branch "v${OPENCLAW_VERSION}-1" https://github.com/openclaw/openclaw.git /tmp/openclaw-src
fi
cd /tmp/openclaw-src
CI=true pnpm --dir ui install --prod=false
pnpm --dir ui build
mkdir -p "${OPENCLAW_ROOT}/dist"
rm -rf "${OPENCLAW_ROOT}/dist/control-ui"
cp -R dist/control-ui "${OPENCLAW_ROOT}/dist/control-ui"
test -f "${CONTROL_UI_INDEX}"
rm -rf /tmp/openclaw-src /root/.local/share/pnpm /root/.cache/pnpm /root/.cache/node/corepack
fi
Loading