Skip to content

Commit

Permalink
Merge pull request kubernetes#1839 from sozercan/fix-arch
Browse files Browse the repository at this point in the history
Fix non-amd64 arch config for debian images
  • Loading branch information
k8s-ci-robot authored Jan 13, 2021
2 parents ce6512e + 8d4e44f commit 1fd673e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions images/build/debian-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,15 @@ else
endif
mv $(TEMP_DIR)/$(CONFIG)/Dockerfile.build.tmp $(TEMP_DIR)/$(CONFIG)/Dockerfile.build

docker build --pull -t $(BUILD_IMAGE) -f $(TEMP_DIR)/$(CONFIG)/Dockerfile.build $(TEMP_DIR)/$(CONFIG)
docker buildx build \
--pull \
--platform $(ARCH) \
-t $(BUILD_IMAGE) \
-f $(TEMP_DIR)/$(CONFIG)/Dockerfile.build $(TEMP_DIR)/$(CONFIG)
docker create --name $(BUILD_IMAGE) $(BUILD_IMAGE)
docker export $(BUILD_IMAGE) > $(TEMP_DIR)/$(CONFIG)/$(TAR_FILE)
docker build \
docker buildx build \
--platform $(ARCH) \
-t $(IMAGE)-$(ARCH):$(IMAGE_VERSION) \
-t $(IMAGE)-$(ARCH):$(TAG)-$(CONFIG) \
-t $(IMAGE)-$(ARCH):latest-$(CONFIG) \
Expand Down
5 changes: 4 additions & 1 deletion images/build/debian-hyperkube-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
$(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset
endif
docker build --pull -t $(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR)
docker buildx build \
--pull \
--platform $(ARCH) \
-t $(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR)
rm -rf $(TEMP_DIR)

push: build
Expand Down
3 changes: 2 additions & 1 deletion images/build/debian-iptables/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ ifneq ($(ARCH),amd64)
$(SUDO) ../../../third_party/multiarch/qemu-user-static/register/register.sh --reset
endif

docker build \
docker buildx build \
--pull \
--platform $(ARCH) \
-t $(IMAGE)-$(ARCH):$(IMAGE_VERSION) \
-t $(IMAGE)-$(ARCH):$(TAG)-$(CONFIG) \
-t $(IMAGE)-$(ARCH):latest-$(CONFIG) \
Expand Down

0 comments on commit 1fd673e

Please sign in to comment.