From 5673f4299a8ea7c750bd562ae5b69ec102677a59 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 4 Jan 2026 04:17:02 +0000 Subject: [PATCH] build: add sandbox common image builder --- scripts/sandbox-common-setup.sh | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 scripts/sandbox-common-setup.sh diff --git a/scripts/sandbox-common-setup.sh b/scripts/sandbox-common-setup.sh new file mode 100755 index 000000000..10aa872cb --- /dev/null +++ b/scripts/sandbox-common-setup.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -euo pipefail + +BASE_IMAGE="${BASE_IMAGE:-clawdis-sandbox:bookworm-slim}" +TARGET_IMAGE="${TARGET_IMAGE:-clawdis-sandbox-common:bookworm-slim}" +PACKAGES="${PACKAGES:-curl wget jq coreutils grep nodejs npm python3 git ca-certificates golang-go rustc cargo}" +INSTALL_PNPM="${INSTALL_PNPM:-1}" +INSTALL_BUN="${INSTALL_BUN:-1}" +BUN_INSTALL_DIR="${BUN_INSTALL_DIR:-/opt/bun}" + +if ! docker image inspect "${BASE_IMAGE}" >/dev/null 2>&1; then + echo "Base image missing: ${BASE_IMAGE}" + echo "Building base image via scripts/sandbox-setup.sh..." + scripts/sandbox-setup.sh +fi + +echo "Building ${TARGET_IMAGE} with: ${PACKAGES}" + +docker build \ + -t "${TARGET_IMAGE}" \ + --build-arg INSTALL_PNPM="${INSTALL_PNPM}" \ + --build-arg INSTALL_BUN="${INSTALL_BUN}" \ + --build-arg BUN_INSTALL_DIR="${BUN_INSTALL_DIR}" \ + - <