Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-amd64 arch config for debian images #1839

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may run into issues here with pulling the base image when using buildkit and gcr mirror (see kubernetes/kubernetes#97982 for more info)

--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