From 3f6facde8c3d897ad5e8d325431871cd0e1b8fb6 Mon Sep 17 00:00:00 2001 From: odidev Date: Wed, 22 Sep 2021 07:37:36 +0000 Subject: [PATCH] Add arm64 support using buildx Signed-off-by: odidev --- .github/workflows/main.yml | 4 ++++ Makefile | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3946d63d..3cd5c63c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,10 @@ jobs: - name: Checkout source uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 - name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }} run: make test diff --git a/Makefile b/Makefile index eda5dbff..e6aa332f 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ # to be the latest. LATEST_VERSION=13-3.1 +AMD_VERSION1=9.6-2.5 +AMD_VERSION2=10-2.5 +AMD_VERSION3=11-2.5 # The following flags are set based on VERSION and VARIANT environment variables # that may have been specified, and are used by rules to determine which # versions/variants are to be processed. If no VERSION or VARIANT environment @@ -123,11 +126,15 @@ push: $(foreach version,$(VERSIONS),push-$(version)) $(PUSH_DEP) define push-version push-$1: test-$1 ifeq ($(do_default),true) +ifeq ($(VERSIONS),$(filter $(VERSIONS),$(AMD_VERSION1) $(AMD_VERSION2) $(AMD_VERSION3) )) $(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version) +else + $(DOCKER) buildx build --platform linux/arm64,linux/amd64 -t $(REPO_NAME)/$(IMAGE_NAME):$(version) --push $1 +endif endif ifeq ($(do_alpine),true) ifneq ("$(wildcard $1/alpine)","") - $(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine + $(DOCKER) buildx build --platform linux/arm64,linux/amd64 -t $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine --push $1/alpine endif endif endef