Skip to content

Commit

Permalink
Make arch-specific releases use separate images instead of tags on th…
Browse files Browse the repository at this point in the history
…e same image

This seems to be the current convention in k8s.
  • Loading branch information
towca committed Dec 15, 2020
1 parent 7af23ba commit 5534fa4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions cluster-autoscaler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ ifdef DOCKER_RM
else
RM_FLAG=
endif
IMAGE=$(REGISTRY)/cluster-autoscaler$(PROVIDER)

export DOCKER_CLI_EXPERIMENTAL := enabled

build: build-arch-$(GOARCH)

Expand All @@ -53,24 +56,24 @@ make-image: make-image-arch-$(GOARCH)
make-image-arch-%:
ifdef BASEIMAGE
docker build --pull --build-arg BASEIMAGE=${BASEIMAGE} \
-t ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$* \
-t ${IMAGE}-$*:${TAG} \
-f Dockerfile.$* .
else
docker build --pull \
-t ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$* \
-t ${IMAGE}-$*:${TAG} \
-f Dockerfile.$* .
endif
@echo "Image ${TAG}${FOR_PROVIDER}-$* completed"

push-image: push-image-arch-$(GOARCH)

push-image-arch-%:
./push_image.sh ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}-$*
./push_image.sh ${IMAGE}-$*:${TAG}

push-manifest:
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest create ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG} \
$(addprefix $(REGISTRY)/cluster-autoscaler$(PROVIDER):$(TAG)-, $(ALL_ARCH))
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest push --purge ${REGISTRY}/cluster-autoscaler${PROVIDER}:${TAG}
docker manifest create ${IMAGE}:${TAG} \
$(addprefix $(REGISTRY)/cluster-autoscaler$(PROVIDER)-, $(addsuffix :$(TAG), $(ALL_ARCH)))
docker manifest push --purge ${IMAGE}:${TAG}

execute-release: $(addprefix make-image-arch-,$(ALL_ARCH)) $(addprefix push-image-arch-,$(ALL_ARCH)) push-manifest
@echo "Release ${TAG}${FOR_PROVIDER} completed"
Expand Down

0 comments on commit 5534fa4

Please sign in to comment.