You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
729 B
Bash

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/usr/bin/env bash
# 在宿主机上构建镜像并在容器内挂载仓库、npm ci、执行 build-linux-deb-all.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
IMAGE_TAG="${IMAGE_TAG:-tauri-linux-deb:24.04}"
cd "$REPO_ROOT"
echo "==> docker build -f scripts/docker/Dockerfile -t $IMAGE_TAG $REPO_ROOT"
docker build -f scripts/docker/Dockerfile -t "$IMAGE_TAG" "$REPO_ROOT"
echo "==> docker run (npm ci + build-linux-deb-all.sh)"
docker run --rm \
--platform linux/amd64 \
-v "$REPO_ROOT:/work" \
-w /work \
-e RUSTUP_HOME=/opt/rustup \
-e CARGO_HOME=/opt/cargo \
"$IMAGE_TAG" \
bash /work/scripts/docker/container-entry.sh "$@"