parent
83f3634d06
commit
935d54c54c
|
|
@ -7,12 +7,9 @@ TAG="$ENV_NAME"
|
||||||
PORT="${PORT:-8077}"
|
PORT="${PORT:-8077}"
|
||||||
cd "$ROOT_DIR"
|
cd "$ROOT_DIR"
|
||||||
|
|
||||||
# 强制构建新镜像,确保使用最新的 Dockerfile
|
# 如果镜像存在,则直接使用;否则构建
|
||||||
if docker image inspect "$IMAGE:$TAG" >/dev/null 2>&1; then
|
if docker image inspect "$IMAGE:$TAG" >/dev/null 2>&1; then
|
||||||
DOCKER_BUILDKIT=1 docker build \
|
echo "镜像 $IMAGE:$TAG 已存在,跳过构建。"
|
||||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
||||||
--build-arg GOPROXY="${GOPROXY:-https://goproxy.cn,direct}" \
|
|
||||||
--cache-from "$IMAGE:$TAG" -t "$IMAGE:$TAG" -f Dockerfile .
|
|
||||||
else
|
else
|
||||||
DOCKER_BUILDKIT=1 docker build \
|
DOCKER_BUILDKIT=1 docker build \
|
||||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue