Skip to content

Commit ac1aa26

Browse files
author
Corellis
committed
Fix 6 issues from controller review
1. Dockerfile.lite: Add Docker CLI + Compose plugin (docker-ce-cli + docker-compose-plugin from official repo) 2. entrypoint.sh: Auto-fix Docker socket permissions for controller (detect host docker GID, create group, add lobster user) 3. spawn-controller.sh: Create empty secrets.json, bump to 3GB/1.5 CPU 4. spawn-lobster.sh: Fix 8 missing JSON commas in openclaw.json template, fix mcporter.json missing closing brace, create empty secrets.json 5. controller-setup.md: Add notes on bind mount live updates 6. CPU/memory: Controller gets 1.5 CPU + 3GB (was 0.5 CPU + 2GB)
1 parent 272bc86 commit ac1aa26

5 files changed

Lines changed: 52 additions & 11 deletions

File tree

docker/Dockerfile.lite

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
3939
# Install AWS CLI via pip
4040
RUN pip3 install --no-cache-dir --break-system-packages awscli
4141

42+
# Install Docker CLI + Compose plugin (for controller lobsters)
43+
# Only the CLI — the daemon runs on the host via socket mount
44+
RUN install -m 0755 -d /etc/apt/keyrings \
45+
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
46+
&& chmod a+r /etc/apt/keyrings/docker.asc \
47+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
48+
> /etc/apt/sources.list.d/docker.list \
49+
&& apt-get update && apt-get install -y --no-install-recommends docker-ce-cli docker-compose-plugin \
50+
&& rm -rf /var/lib/apt/lists/*
51+
4252
# Install noVNC
4353
RUN git clone --depth 1 https://github.com/novnc/noVNC.git /opt/noVNC \
4454
&& git clone --depth 1 https://github.com/novnc/websockify.git /opt/noVNC/utils/websockify

docker/entrypoint.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,19 @@ fi
137137
# Clean up stale session lock files from previous crash
138138
find /home/lobster/.openclaw/agents -name "*.lock" -delete 2>/dev/null || true
139139

140+
# === Controller: Docker socket permissions ===
141+
# If LOBSTER_ROLE=controller and docker.sock is mounted, grant lobster access
142+
if [ "$LOBSTER_ROLE" = "controller" ] && [ -S /var/run/docker.sock ]; then
143+
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
144+
if [ "$DOCKER_GID" != "0" ]; then
145+
# Create a group with the host's docker GID and add lobster to it
146+
groupadd -g "$DOCKER_GID" hostdocker 2>/dev/null || true
147+
usermod -aG hostdocker lobster 2>/dev/null || true
148+
else
149+
# Socket owned by root — allow lobster via sudo
150+
echo "lobster ALL=(root) NOPASSWD: /usr/bin/docker" >> /etc/sudoers.d/lobster-docker 2>/dev/null || true
151+
fi
152+
fi
153+
140154
# Switch to lobster and run the main command (OpenClaw)
141155
exec gosu lobster env HOME=/home/lobster "$@"

docs/guides/controller-setup.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,11 @@ If you already have lobsters running and want to promote one to controller,
9494
you'll need to update its service definition in `docker-compose.yml` to add
9595
the controller-specific volumes. See `spawn-controller.sh` for the exact
9696
volume mounts needed.
97+
98+
## Notes
99+
100+
- **Bind mount changes are live.** When the controller edits `company-config/` files,
101+
all other lobsters see the changes immediately (they mount the same host directory).
102+
No restart needed for file content changes.
103+
- **Docker Compose changes require restart.** If the controller edits `docker-compose.yml`
104+
(e.g., adding a new lobster), it needs to run `docker compose up -d` to apply.

scripts/spawn-controller.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ JSONEOF
143143
# Copy ACP config from template
144144
cp "$FARM_DIR/templates/acp.json" "$CONFIG_DIR/acp.json" 2>/dev/null || true
145145

146+
# Create empty secrets.json (lobsters store personal secrets here)
147+
echo '{}' > "$CONFIG_DIR/secrets.json"
148+
chmod 644 "$CONFIG_DIR/secrets.json"
149+
146150
# ── Controller-specific workspace files ──
147151
cat > "$CONFIG_DIR/workspace/AGENTS.md" << 'AGENTSEOF'
148152
# AGENTS.md — Controller Lobster
@@ -255,9 +259,9 @@ cat >> "$COMPOSE_FILE" << YAMLEOF
255259
- HOME=/home/lobster
256260
- LOBSTER_ROLE=controller
257261
tty: true
258-
mem_limit: 2g
262+
mem_limit: 3g
259263
shm_size: 512m
260-
cpus: 0.5
264+
cpus: 1.5
261265
YAMLEOF
262266

263267
# Add volume declaration

scripts/spawn-lobster.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ cat > "$CONFIG_DIR/openclaw.json" << JSONEOF
7979
]
8080
}
8181
}
82-
}
82+
},
8383
"agents": {
8484
"defaults": {
8585
"model": {
@@ -93,15 +93,15 @@ cat > "$CONFIG_DIR/openclaw.json" << JSONEOF
9393
"maxConcurrent": 4
9494
}
9595
}
96-
}
96+
},
9797
"session": {
9898
"dmScope": "per-peer",
9999
"identityLinks": {
100100
"owner": [
101101
"slack:${SLACK_USER_ID}"
102102
]
103103
}
104-
}
104+
},
105105
"channels": {
106106
"slack": {
107107
"mode": "socket",
@@ -122,7 +122,7 @@ cat > "$CONFIG_DIR/openclaw.json" << JSONEOF
122122
"nativeStreaming": true,
123123
"streaming": "partial"
124124
}
125-
}
125+
},
126126
"gateway": {
127127
"port": 18789,
128128
"mode": "local",
@@ -134,18 +134,18 @@ cat > "$CONFIG_DIR/openclaw.json" << JSONEOF
134134
"controlUi": {
135135
"dangerouslyAllowHostHeaderOriginFallback": true
136136
}
137-
}
137+
},
138138
"talk": {
139139
"provider": "elevenlabs",
140140
"providers": {
141141
"elevenlabs": {
142142
"apiKey": "${ELEVENLABS_API_KEY:-}"
143143
}
144144
}
145-
}
145+
},
146146
"acp": {
147147
"\$include": "./acp.json"
148-
}
148+
},
149149
"tools": {
150150
"profile": "full",
151151
"sessions": {
@@ -154,7 +154,7 @@ cat > "$CONFIG_DIR/openclaw.json" << JSONEOF
154154
"agentToAgent": {
155155
"enabled": true
156156
}
157-
}
157+
},
158158
"plugins": {
159159
"entries": {
160160
"acpx": {
@@ -171,6 +171,10 @@ JSONEOF
171171
# Copy ACP config from template
172172
cp "$FARM_DIR/templates/acp.json" "$CONFIG_DIR/acp.json"
173173

174+
# Create empty secrets.json (lobsters store personal secrets here)
175+
echo '{}' > "$CONFIG_DIR/secrets.json"
176+
chmod 644 "$CONFIG_DIR/secrets.json"
177+
174178
# Generate workspace files — use full template
175179
# Generate AGENTS.md inline
176180
cat > "$CONFIG_DIR/workspace/AGENTS.md" << 'AGENTSEOF'
@@ -230,7 +234,8 @@ cat > "$CONFIG_DIR/workspace/config/mcporter.json" << 'MCPEOF'
230234
"env": {}
231235
}
232236
}
233-
MCPEOF
237+
}
238+
MCPEOF
234239

235240
# Append service to docker-compose.yml (before the final volumes: section if it exists)
236241
# We need to insert into the services: block properly

0 commit comments

Comments
 (0)