Skip to content

Commit 0ca1633

Browse files
committed
build images for both linux/amd64 & linux/arm64 archs
1 parent 9282110 commit 0ca1633

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/container-structure-test.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
', github.ref)
5151
strategy:
5252
matrix:
53+
platforms: 'linux/amd64,linux/arm64'
5354
drupal_version: ['8.9', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5', '10.0', '10.1']
5455
include:
5556
- drupal_version: '8.9'
@@ -74,7 +75,7 @@ jobs:
7475
- name: checkout source
7576
uses: actions/checkout@master
7677
- name: Build docker images
77-
run: make
78+
run: ARCH_TO_BUILD=${{ matrix.platforms }} make
7879
working-directory: ${{ matrix.drupal_major }}/${{ matrix.drupal_version }}
7980
-
8081
name: Login to DockerHub

10/10.0/Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ DRUPAL_VER ?= 10.0
22
DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+\.[0-9]+')
33

44
BASE_IMAGE_TAG = 10.0
5+
ARCH_TO_BUILD ?= "linux/amd64"
56

67
REPO = wengerk/drupal-for-contrib
78
NAME = drupal-$(DRUPAL_VER_MAJOR)
@@ -23,13 +24,15 @@ endif
2324
default: build
2425

2526
build:
26-
docker build -t $(REPO):$(TAG) \
27+
docker buildx build -t $(REPO):$(TAG) \
28+
--platform=${ARCH_TO_BUILD} \
2729
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
2830
--build-arg DRUPAL_VER=$(DRUPAL_VER) \
2931
./
3032

3133
build-nc:
32-
docker build -t $(REPO):$(TAG) \
34+
docker buildx build -t $(REPO):$(TAG) \
35+
--platform=${ARCH_TO_BUILD} \
3336
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
3437
--build-arg DRUPAL_VER=$(DRUPAL_VER) \
3538
--no-cache --pull \

10/10.1/Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ DRUPAL_VER ?= 10.1
22
DRUPAL_VER_MAJOR ?= $(shell echo "${DRUPAL_VER}" | grep -oE '^[0-9]+\.[0-9]+')
33

44
BASE_IMAGE_TAG = 10.0
5+
ARCH_TO_BUILD ?= "linux/amd64"
56

67
REPO = wengerk/drupal-for-contrib
78
NAME = drupal-$(DRUPAL_VER_MAJOR)
@@ -23,13 +24,15 @@ endif
2324
default: build
2425

2526
build:
26-
docker build -t $(REPO):$(TAG) \
27+
docker buildx build -t $(REPO):$(TAG) \
28+
--platform=${ARCH_TO_BUILD} \
2729
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
2830
--build-arg DRUPAL_VER=$(DRUPAL_VER) \
2931
./
3032

3133
build-nc:
32-
docker build -t $(REPO):$(TAG) \
34+
docker buildx build -t $(REPO):$(TAG) \
35+
--platform=${ARCH_TO_BUILD} \
3336
--build-arg BASE_IMAGE_TAG=$(BASE_IMAGE_TAG) \
3437
--build-arg DRUPAL_VER=$(DRUPAL_VER) \
3538
--no-cache --pull \

0 commit comments

Comments
 (0)