diff --git a/components/egress/build.sh b/components/egress/build.sh index 6f5bd4d5..bce009a9 100755 --- a/components/egress/build.sh +++ b/components/egress/build.sh @@ -27,9 +27,15 @@ docker buildx create --use --name egress-builder docker buildx inspect --bootstrap docker buildx ls +LATEST_TAGS=() +if [[ "${TAG}" == v* ]]; then + LATEST_TAGS+=(-t opensandbox/egress:latest -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:latest) +fi + docker buildx build \ -t opensandbox/egress:${TAG} \ -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/egress:${TAG} \ + "${LATEST_TAGS[@]}" \ -f components/egress/Dockerfile \ --build-arg VERSION="${VERSION}" \ --build-arg GIT_COMMIT="${GIT_COMMIT}" \ diff --git a/components/execd/build.sh b/components/execd/build.sh index f7f9d6ec..a111eef8 100755 --- a/components/execd/build.sh +++ b/components/execd/build.sh @@ -31,9 +31,15 @@ docker buildx inspect --bootstrap docker buildx ls +LATEST_TAGS=() +if [[ "${TAG}" == v* ]]; then + LATEST_TAGS+=(-t opensandbox/execd:latest -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:latest) +fi + docker buildx build \ -t opensandbox/execd:${TAG} \ -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:${TAG} \ + "${LATEST_TAGS[@]}" \ -f components/execd/Dockerfile \ --build-arg VERSION="${VERSION}" \ --build-arg GIT_COMMIT="${GIT_COMMIT}" \ diff --git a/components/ingress/build.sh b/components/ingress/build.sh index bdef44dc..c132df76 100755 --- a/components/ingress/build.sh +++ b/components/ingress/build.sh @@ -31,9 +31,15 @@ docker buildx inspect --bootstrap docker buildx ls +LATEST_TAGS=() +if [[ "${TAG}" == v* ]]; then + LATEST_TAGS+=(-t opensandbox/ingress:latest -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/ingress:latest) +fi + docker buildx build \ -t opensandbox/ingress:${TAG} \ -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/ingress:${TAG} \ + "${LATEST_TAGS[@]}" \ -f components/ingress/Dockerfile \ --build-arg VERSION="${VERSION}" \ --build-arg GIT_COMMIT="${GIT_COMMIT}" \ diff --git a/server/build.sh b/server/build.sh index 98f6f545..feb1c856 100755 --- a/server/build.sh +++ b/server/build.sh @@ -25,9 +25,15 @@ docker buildx inspect --bootstrap docker buildx ls +LATEST_TAGS=() +if [[ "${TAG}" == v* ]]; then + LATEST_TAGS+=(-t opensandbox/server:latest -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:latest) +fi + docker buildx build \ -t opensandbox/server:${TAG} \ -t sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/server:${TAG} \ + "${LATEST_TAGS[@]}" \ --platform linux/amd64,linux/arm64 \ --push \ . \ No newline at end of file