Skip to content

Commit 25fa4ea

Browse files
committed
STAC-0 Add docker build. [6]
1 parent c0bc722 commit 25fa4ea

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

docker-build.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,28 @@ push_architectures() {
162162
build_and_push() {
163163
print_step "Building and pushing all images..."
164164

165-
# Prepare tags
166-
local tags="--tag ${IMAGE_NAME}:${GIT_SHA} --tag ${IMAGE_NAME}:${GIT_SHA}-amd64 --tag ${IMAGE_NAME}:${GIT_SHA}-arm64"
167-
168-
# Add version tags if this is a release
169-
if [[ -n "${GIT_TAG}" ]]; then
170-
print_status "Adding version tags..."
171-
tags="${tags} --tag ${IMAGE_NAME}:${GIT_TAG} --tag ${IMAGE_NAME}:${GIT_TAG}-amd64 --tag ${IMAGE_NAME}:${GIT_TAG}-arm64"
172-
fi
173-
174165
# Build for both architectures and create manifest
175166
docker buildx build \
176167
--platform linux/amd64,linux/arm64 \
177-
${tags} \
168+
--tag ${IMAGE_NAME}:${GIT_SHA} \
169+
--tag ${IMAGE_NAME}:${GIT_SHA}-amd64 \
170+
--tag ${IMAGE_NAME}:${GIT_SHA}-arm64 \
178171
--file Dockerfile \
179172
--push \
180173
.
174+
175+
# Add version tags if this is a release
176+
if [[ -n "${GIT_TAG}" ]]; then
177+
print_status "Adding version tags..."
178+
docker buildx build \
179+
--platform linux/amd64,linux/arm64 \
180+
--tag ${IMAGE_NAME}:${GIT_TAG} \
181+
--tag ${IMAGE_NAME}:${GIT_TAG}-amd64 \
182+
--tag ${IMAGE_NAME}:${GIT_TAG}-arm64 \
183+
--file Dockerfile \
184+
--push \
185+
.
186+
fi
181187
}
182188

183189
# Build only (no push)

0 commit comments

Comments
 (0)