fix(deploy_image): 移除默认平台设置并改进平台参数处理
修改部署脚本以支持动态平台参数,移除默认的linux/amd64设置 在帮助信息中添加平台参数说明
This commit is contained in:
parent
3453570dc6
commit
85e86abbce
|
|
@ -4,7 +4,7 @@ set -euo pipefail
|
|||
ENV=${1:-test}
|
||||
IMAGE=${2:-marketingsystemdatatool_msdt:latest}
|
||||
CMD=${3:-up}
|
||||
PLATFORM=${PLATFORM:-linux/amd64}
|
||||
PLATFORM=${PLATFORM:-}
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
|
||||
|
|
@ -17,8 +17,9 @@ fi
|
|||
case "$CMD" in
|
||||
up)
|
||||
docker rm -f msdt >/dev/null 2>&1 || true
|
||||
docker run -d --name msdt \
|
||||
--platform "$PLATFORM" \
|
||||
PLATFORM_FLAG=""
|
||||
if [ -n "$PLATFORM" ]; then PLATFORM_FLAG="--platform $PLATFORM"; fi
|
||||
docker run -d --name msdt $PLATFORM_FLAG \
|
||||
-p 8077:8077 \
|
||||
-e APP_ENV="$ENV" \
|
||||
-e MARKETING_DB_HOST="${MARKETING_DB_HOST:-}" \
|
||||
|
|
@ -41,5 +42,6 @@ case "$CMD" in
|
|||
docker logs -f msdt ;;
|
||||
*)
|
||||
echo "usage: deploy_image.sh <env> <image> [up|down|restart|logs]" >&2
|
||||
echo "env overrides: set PLATFORM=linux/amd64 or PLATFORM=linux/arm64 if needed" >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Reference in New Issue