Skip to content

Commit

Permalink
Merge pull request #5875 from kgolab/docker-container-fix
Browse files Browse the repository at this point in the history
Explicitly create and remove buildx builders
  • Loading branch information
k8s-ci-robot authored Jun 20, 2023
2 parents 3221336 + d4e93a7 commit cd5ed0b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
11 changes: 9 additions & 2 deletions vertical-pod-autoscaler/pkg/admission-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -78,9 +78,16 @@ build-in-docker: $(addprefix build-in-docker-,$(ALL_ARCHITECTURES))
build-in-docker-%: clean docker-builder
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/admission-controller'

.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

.PHONY: release
release: build-in-docker docker-build docker-push
release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down
12 changes: 10 additions & 2 deletions vertical-pod-autoscaler/pkg/recommender/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -78,7 +78,15 @@ build-in-docker: $(addprefix build-in-docker-,$(ALL_ARCHITECTURES))
build-in-docker-%: clean docker-builder
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/recommender'

release: build-in-docker docker-build docker-push
.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down
12 changes: 10 additions & 2 deletions vertical-pod-autoscaler/pkg/updater/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -78,8 +78,16 @@ build-in-docker: $(addprefix build-in-docker-,$(ALL_ARCHITECTURES))
build-in-docker-%: clean docker-builder
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/updater'

.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

.PHONY: release
release: build-in-docker docker-build docker-push
release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down

0 comments on commit cd5ed0b

Please sign in to comment.