fix: use explicit docker path in imgproxy release

This commit is contained in:
john
2026-07-15 11:53:06 +08:00
parent 72f1266078
commit 3695fecbb6
3 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -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\/\*/);
+3 -2
View File
@@ -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 \
+2 -1
View File
@@ -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"