From 2a86e40730f9ab0b1b4e671c4729daad503de0da Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 10 Jan 2026 22:42:57 +0100 Subject: [PATCH] fix: keep docker home volume mounts --- CHANGELOG.md | 1 + docker-setup.sh | 41 ++++++++++++++++++++++------------------- docs/install/docker.md | 5 ++++- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2525af715..a9f30f7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Providers: unify group history context wrappers across providers with per-provider/per-account `historyLimit` overrides (fallback to `messages.groupChat.historyLimit`). Set `0` to disable. (#672) — thanks @steipete. - CLI: add `clawdbot update` (safe-ish git checkout update) + `--update` shorthand. (#673) — thanks @fm1randa. - Gateway: add OpenAI-compatible `/v1/chat/completions` HTTP endpoint (auth, SSE streaming, per-agent routing). (#680) — thanks @steipete. +- Docker: allow optional home volume + extra bind mounts in `docker-setup.sh`. (#679) — thanks @gabriel-trigo. ### Fixes - macOS: stabilize bridge tunnels, guard invoke senders on disconnect, and drain stdout/stderr to avoid deadlocks. (#676) — thanks @ngutman. diff --git a/docker-setup.sh b/docker-setup.sh index 9b8bdfff9..d24a31611 100755 --- a/docker-setup.sh +++ b/docker-setup.sh @@ -48,14 +48,11 @@ COMPOSE_FILES=("$COMPOSE_FILE") COMPOSE_ARGS=() write_extra_compose() { - local mounts_csv="$1" - local home_volume="$2" - local -a mounts=() + local home_volume="$1" + shift + local -a mounts=("$@") local mount - # Split on commas; ignore empty entries. - IFS=',' read -r -a mounts <<<"$mounts_csv" - cat >"$EXTRA_COMPOSE_FILE" <<'YAML' services: clawdbot-gateway: @@ -64,14 +61,11 @@ YAML if [[ -n "$home_volume" ]]; then printf ' - %s:/home/node\n' "$home_volume" >>"$EXTRA_COMPOSE_FILE" + printf ' - %s:/home/node/.clawdbot\n' "$CLAWDBOT_CONFIG_DIR" >>"$EXTRA_COMPOSE_FILE" + printf ' - %s:/home/node/clawd\n' "$CLAWDBOT_WORKSPACE_DIR" >>"$EXTRA_COMPOSE_FILE" fi for mount in "${mounts[@]}"; do - mount="${mount#"${mount%%[![:space:]]*}"}" - mount="${mount%"${mount##*[![:space:]]}"}" - if [[ -z "$mount" ]]; then - continue - fi printf ' - %s\n' "$mount" >>"$EXTRA_COMPOSE_FILE" done @@ -82,18 +76,15 @@ YAML if [[ -n "$home_volume" ]]; then printf ' - %s:/home/node\n' "$home_volume" >>"$EXTRA_COMPOSE_FILE" + printf ' - %s:/home/node/.clawdbot\n' "$CLAWDBOT_CONFIG_DIR" >>"$EXTRA_COMPOSE_FILE" + printf ' - %s:/home/node/clawd\n' "$CLAWDBOT_WORKSPACE_DIR" >>"$EXTRA_COMPOSE_FILE" fi for mount in "${mounts[@]}"; do - mount="${mount#"${mount%%[![:space:]]*}"}" - mount="${mount%"${mount##*[![:space:]]}"}" - if [[ -z "$mount" ]]; then - continue - fi printf ' - %s\n' "$mount" >>"$EXTRA_COMPOSE_FILE" done - if [[ -n "$home_volume" ]]; then + if [[ -n "$home_volume" && "$home_volume" != *"/"* ]]; then cat >>"$EXTRA_COMPOSE_FILE" <