From 3695fecbb6c76661768e1449b9ea39f3e796d178 Mon Sep 17 00:00:00 2001 From: john Date: Wed, 15 Jul 2026 11:53:06 +0800 Subject: [PATCH] fix: use explicit docker path in imgproxy release --- scripts/imgproxy-runtime-package.test.mjs | 4 +++- scripts/install-imgproxy-runtime-prod.sh | 5 +++-- scripts/release-imgproxy-runtime-prod.sh | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/imgproxy-runtime-package.test.mjs b/scripts/imgproxy-runtime-package.test.mjs index 3d26549..63a84fa 100644 --- a/scripts/imgproxy-runtime-package.test.mjs +++ b/scripts/imgproxy-runtime-package.test.mjs @@ -23,13 +23,15 @@ test('installer uses a read-only storage mount and both required ports', () => { assert.match(installer, /\$MINDSPACE_STORAGE_ROOT:\/mnt\/images:ro/); assert.match(installer, /10\.10\.0\.2/); assert.match(installer, /IMGPROXY_UPSTREAM/); + assert.match(installer, /DOCKER_BIN/); }); test('release verifies checksums before loading the image and backs up launch state', () => { const release = read('scripts/release-imgproxy-runtime-prod.sh'); assert.match(release, /shasum -a 256 -c/); assert.match(release, /shasum -a 256 "imgproxy-runtime-\$RELEASE_ID\.tar\.gz"/); - assert.match(release, /docker load/); + assert.match(release, /"\$DOCKER_BIN" load/); + assert.match(release, /DOCKER_BIN/); assert.match(release, /imgproxy-compat-\$RELEASE_ID\.plist/); assert.match(release, /img\.tkmind\.cn\/health/); assert.match(release, /release\/\*/); diff --git a/scripts/install-imgproxy-runtime-prod.sh b/scripts/install-imgproxy-runtime-prod.sh index 9507817..1de0d24 100644 --- a/scripts/install-imgproxy-runtime-prod.sh +++ b/scripts/install-imgproxy-runtime-prod.sh @@ -7,6 +7,7 @@ RUNTIME_DIR="${IMGPROXY_RUNTIME_DIR:?IMGPROXY_RUNTIME_DIR is required}" IMAGE_TAG="${IMGPROXY_IMAGE_TAG:?IMGPROXY_IMAGE_TAG is required}" CONTAINER="${IMGPROXY_CONTAINER:-memind-imgproxy}" NODE_BIN="${NODE_BIN:-/opt/homebrew/opt/node@24/bin/node}" +DOCKER_BIN="${DOCKER_BIN:-/opt/homebrew/bin/docker}" PLIST="$HOME/Library/LaunchAgents/cn.tkmind.imgproxy-compat.plist" GUI="gui/$(id -u)" @@ -17,8 +18,8 @@ set +a : "${IMGPROXY_SIGNING_SALT:?missing IMGPROXY_SIGNING_SALT}" : "${MINDSPACE_STORAGE_ROOT:?missing MINDSPACE_STORAGE_ROOT}" -docker rm -f "$CONTAINER" >/dev/null 2>&1 || true -docker run -d --name "$CONTAINER" --restart unless-stopped \ +"$DOCKER_BIN" rm -f "$CONTAINER" >/dev/null 2>&1 || true +"$DOCKER_BIN" run -d --name "$CONTAINER" --restart unless-stopped \ -p 127.0.0.1:20082:8080 \ -v "$MINDSPACE_STORAGE_ROOT:/mnt/images:ro" \ -e IMGPROXY_LOCAL_FILESYSTEM_ROOT=/mnt/images \ diff --git a/scripts/release-imgproxy-runtime-prod.sh b/scripts/release-imgproxy-runtime-prod.sh index deeb23a..9081dc3 100644 --- a/scripts/release-imgproxy-runtime-prod.sh +++ b/scripts/release-imgproxy-runtime-prod.sh @@ -6,6 +6,7 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" HOST="${STUDIO_HOST:-john@58.38.22.103}" REMOTE_ROOT="${STUDIO_REMOTE_ROOT:-/Users/john/Project}" +DOCKER_BIN="${DOCKER_BIN:-/opt/homebrew/bin/docker}" RUNTIME_BASE="$REMOTE_ROOT/imgproxy-runtime" INCOMING="$REMOTE_ROOT/incoming/imgproxy-runtime" RELEASE_ID="$(date +%Y%m%d-%H%M%S)-$(git -C "$ROOT" rev-parse --short HEAD)" @@ -47,7 +48,7 @@ cp "$HOME/Library/LaunchAgents/cn.tkmind.imgproxy-compat.plist" "$RUNTIME_BASE/b tar -xzf "$archive" -C "$release_dir" --strip-components=1 cd "$release_dir" shasum -a 256 -c imgproxy-runtime-image.tar.gz.sha256 -gunzip -c imgproxy-runtime-image.tar.gz | docker load +gunzip -c imgproxy-runtime-image.tar.gz | "$DOCKER_BIN" load image_tag="$(cat image-tag.txt)" IMGPROXY_RUNTIME_DIR="$release_dir" IMGPROXY_IMAGE_TAG="$image_tag" bash ./install-imgproxy-runtime-prod.sh ln -sfn "$release_dir" "$RUNTIME_BASE/current"