|
1 | 1 | # syntax=docker/dockerfile:1.7 |
2 | 2 | |
3 | | -# Opt-in extension dependencies at build time (space-separated directory names). |
4 | | -# Example: docker build --build-arg OPENCLAW_EXTENSIONS="diagnostics-otel matrix" . |
| 3 | +# Opt-in plugin dependencies at build time (space- or comma-separated directory names). |
| 4 | +# Example: docker build --build-arg OPENCLAW_EXTENSIONS="diagnostics-otel,matrix" . |
5 | 5 | # |
6 | 6 | # Multi-stage build produces a minimal runtime image without build tools, |
7 | 7 | # source code, or Bun. Works with Docker, Buildx, and Podman. |
@@ -32,7 +32,7 @@ ARG OPENCLAW_BUNDLED_PLUGIN_DIR
|
32 | 32 | # Copy package.json for opted-in extensions so pnpm resolves their deps. |
33 | 33 | RUN --mount=type=bind,source=${OPENCLAW_BUNDLED_PLUGIN_DIR},target=/tmp/${OPENCLAW_BUNDLED_PLUGIN_DIR},readonly \ |
34 | 34 | mkdir -p /out && \ |
35 | | - for ext in $OPENCLAW_EXTENSIONS; do \ |
| 35 | + for ext in $(printf '%s\n' "$OPENCLAW_EXTENSIONS" | tr ',' ' '); do \ |
36 | 36 | if [ -f "/tmp/${OPENCLAW_BUNDLED_PLUGIN_DIR}/$ext/package.json" ]; then \ |
37 | 37 | mkdir -p "/out/$ext" && \ |
38 | 38 | cp "/tmp/${OPENCLAW_BUNDLED_PLUGIN_DIR}/$ext/package.json" "/out/$ext/package.json"; \ |
@@ -118,7 +118,7 @@ ARG OPENCLAW_BUNDLED_PLUGIN_DIR
|
118 | 118 | # prune must not rediscover unrelated workspaces from the later full source |
119 | 119 | # copy. |
120 | 120 | RUN printf 'packages:\n - .\n - ui\n' > /tmp/pnpm-workspace.runtime.yaml && \ |
121 | | - for ext in $OPENCLAW_EXTENSIONS; do \ |
| 121 | + for ext in $(printf '%s\n' "$OPENCLAW_EXTENSIONS" | tr ',' ' '); do \ |
122 | 122 | printf ' - %s/%s\n' "$OPENCLAW_BUNDLED_PLUGIN_DIR" "$ext" >> /tmp/pnpm-workspace.runtime.yaml; \ |
123 | 123 | done && \ |
124 | 124 | cp /tmp/pnpm-workspace.runtime.yaml pnpm-workspace.yaml && \ |
|