Skip to content

Commit

Permalink
Add arm64 support using buildx
Browse files Browse the repository at this point in the history
Signed-off-by: odidev <odidev@puresoftware.com>
  • Loading branch information
odidev committed Sep 29, 2021
1 parent 1cf6764 commit 3f6facd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f6facd

Please sign in to comment.