Skip to content

Commit 3f6facd

Browse files
committed
Add arm64 support using buildx
Signed-off-by: odidev <[email protected]>
1 parent 1cf6764 commit 3f6facd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ jobs:
4343
- name: Checkout source
4444
uses: actions/checkout@v2
4545

46+
- name: Set up QEMU
47+
uses: docker/setup-qemu-action@v1
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v1
4650
- name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }}
4751
run: make test
4852

Makefile

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# to be the latest.
55
LATEST_VERSION=13-3.1
66

7+
AMD_VERSION1=9.6-2.5
8+
AMD_VERSION2=10-2.5
9+
AMD_VERSION3=11-2.5
710
# The following flags are set based on VERSION and VARIANT environment variables
811
# that may have been specified, and are used by rules to determine which
912
# versions/variants are to be processed. If no VERSION or VARIANT environment
@@ -123,11 +126,15 @@ push: $(foreach version,$(VERSIONS),push-$(version)) $(PUSH_DEP)
123126
define push-version
124127
push-$1: test-$1
125128
ifeq ($(do_default),true)
129+
ifeq ($(VERSIONS),$(filter $(VERSIONS),$(AMD_VERSION1) $(AMD_VERSION2) $(AMD_VERSION3) ))
126130
$(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version)
131+
else
132+
$(DOCKER) buildx build --platform linux/arm64,linux/amd64 -t $(REPO_NAME)/$(IMAGE_NAME):$(version) --push $1
133+
endif
127134
endif
128135
ifeq ($(do_alpine),true)
129136
ifneq ("$(wildcard $1/alpine)","")
130-
$(DOCKER) image push $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine
137+
$(DOCKER) buildx build --platform linux/arm64,linux/amd64 -t $(REPO_NAME)/$(IMAGE_NAME):$(version)-alpine --push $1/alpine
131138
endif
132139
endif
133140
endef

0 commit comments

Comments
 (0)