Merge pull request #697 from gabriel-trigo/feat/docker-apt-packages
feat(docker): optional apt packages in docker-setup
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- CLI/Status: improve Tailscale reporting in `status --all` and harden parsing of noisy `tailscale status --json` output.
|
||||
- CLI/Status: make `status --all` scan progress determinate (OSC progress + spinner).
|
||||
- Terminal/Table: ANSI-safe wrapping to prevent table clipping/color loss; add regression coverage.
|
||||
- Docker: allow optional apt packages during image build and document the build arg. (#697) — thanks @gabriel-trigo.
|
||||
- CLI/Update: gate progress spinner on stdout TTY and align clean-check step label. (#701) — thanks @bjesuiter.
|
||||
- macOS: clear unsigned launchd overrides on signed restarts and warn via doctor when attach-only/disable markers are set. (#695) — thanks @jeffersonwarrior.
|
||||
- Agents: enforce single-writer session locks and drop orphan tool results to prevent tool-call ID failures (MiniMax/Anthropic-compatible APIs).
|
||||
|
||||
@@ -8,6 +8,14 @@ RUN corepack enable
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG CLAWDBOT_DOCKER_APT_PACKAGES=""
|
||||
RUN if [ -n "$CLAWDBOT_DOCKER_APT_PACKAGES" ]; then \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $CLAWDBOT_DOCKER_APT_PACKAGES && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
|
||||
fi
|
||||
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
COPY ui/package.json ./ui/package.json
|
||||
COPY patches ./patches
|
||||
|
||||
@@ -30,6 +30,7 @@ export CLAWDBOT_GATEWAY_PORT="${CLAWDBOT_GATEWAY_PORT:-18789}"
|
||||
export CLAWDBOT_BRIDGE_PORT="${CLAWDBOT_BRIDGE_PORT:-18790}"
|
||||
export CLAWDBOT_GATEWAY_BIND="${CLAWDBOT_GATEWAY_BIND:-lan}"
|
||||
export CLAWDBOT_IMAGE="$IMAGE_NAME"
|
||||
export CLAWDBOT_DOCKER_APT_PACKAGES="${CLAWDBOT_DOCKER_APT_PACKAGES:-}"
|
||||
|
||||
if [[ -z "${CLAWDBOT_GATEWAY_TOKEN:-}" ]]; then
|
||||
if command -v openssl >/dev/null 2>&1; then
|
||||
@@ -161,10 +162,15 @@ upsert_env "$ENV_FILE" \
|
||||
CLAWDBOT_GATEWAY_TOKEN \
|
||||
CLAWDBOT_IMAGE \
|
||||
CLAWDBOT_EXTRA_MOUNTS \
|
||||
CLAWDBOT_HOME_VOLUME
|
||||
CLAWDBOT_HOME_VOLUME \
|
||||
CLAWDBOT_DOCKER_APT_PACKAGES
|
||||
|
||||
echo "==> Building Docker image: $IMAGE_NAME"
|
||||
docker build -t "$IMAGE_NAME" -f "$ROOT_DIR/Dockerfile" "$ROOT_DIR"
|
||||
docker build \
|
||||
--build-arg "CLAWDBOT_DOCKER_APT_PACKAGES=${CLAWDBOT_DOCKER_APT_PACKAGES}" \
|
||||
-t "$IMAGE_NAME" \
|
||||
-f "$ROOT_DIR/Dockerfile" \
|
||||
"$ROOT_DIR"
|
||||
|
||||
echo ""
|
||||
echo "==> Onboarding (interactive)"
|
||||
|
||||
@@ -43,6 +43,11 @@ This script:
|
||||
- starts the gateway via Docker Compose
|
||||
- generates a gateway token and writes it to `.env`
|
||||
|
||||
Optional env vars:
|
||||
- `CLAWDBOT_DOCKER_APT_PACKAGES` — install extra apt packages during build
|
||||
- `CLAWDBOT_EXTRA_MOUNTS` — add extra host bind mounts
|
||||
- `CLAWDBOT_HOME_VOLUME` — persist `/home/node` in a named volume
|
||||
|
||||
After it finishes:
|
||||
- Open `http://127.0.0.1:18789/` in your browser.
|
||||
- Paste the token into the Control UI (Settings → token).
|
||||
@@ -109,6 +114,25 @@ Notes:
|
||||
extra compose file.
|
||||
- The named volume persists until removed with `docker volume rm <name>`.
|
||||
|
||||
### Install extra apt packages (optional)
|
||||
|
||||
If you need system packages inside the image (for example, build tools or media
|
||||
libraries), set `CLAWDBOT_DOCKER_APT_PACKAGES` before running `docker-setup.sh`.
|
||||
This installs the packages during the image build, so they persist even if the
|
||||
container is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
export CLAWDBOT_DOCKER_APT_PACKAGES="ffmpeg build-essential"
|
||||
./docker-setup.sh
|
||||
```
|
||||
|
||||
Notes:
|
||||
- This accepts a space-separated list of apt package names.
|
||||
- If you change `CLAWDBOT_DOCKER_APT_PACKAGES`, rerun `docker-setup.sh` to rebuild
|
||||
the image.
|
||||
|
||||
### Faster rebuilds (recommended)
|
||||
|
||||
To speed up rebuilds, order your Dockerfile so dependency layers are cached.
|
||||
|
||||
Reference in New Issue
Block a user