diff --git a/brew_entrypoint.sh b/brew_entrypoint.sh new file mode 100644 index 0000000..5fd36f8 --- /dev/null +++ b/brew_entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# Installs Homebrew into the mounted volume the first time the container starts, +# then hands off to the normal OpenClaw command. +set -e + +BREW_PREFIX=/home/linuxbrew/.linuxbrew + +if [ ! -x "$BREW_PREFIX/bin/brew" ]; then + echo "[brew] First start: installing Homebrew into $BREW_PREFIX" + mkdir -p "$BREW_PREFIX/bin" + git clone --depth=1 https://github.com/Homebrew/brew "$BREW_PREFIX/Homebrew" + ln -sf ../Homebrew/bin/brew "$BREW_PREFIX/bin/brew" + "$BREW_PREFIX/bin/brew" update --force --quiet + echo "[brew] Done." +fi + +exec "$@" \ No newline at end of file