Skip to content

Commit beb6c56

Browse files
committed
Build ARM64 and ARMv7 images along side AMD64 images (x86)
1 parent f2bc0d6 commit beb6c56

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ env:
33
DOCKER_IMAGE: wyrihaximusnet/php
44
DOCKER_BUILDKIT: 1
55
DOCKER_IMAGE_REGISTRIES_SECRET_MAPPING: '{"ghcr.io":"GHCR_TOKEN","docker.io":"HUB_PASSCODE"}'
6+
DOCKER_CLI_EXPERIMENTAL: enabled
67
on:
78
push:
89
branches:
@@ -116,6 +117,12 @@ jobs:
116117
image: ${{ fromJson(needs.image-matrix.outputs.image) }}
117118
steps:
118119
- uses: actions/checkout@v2
120+
- name: Set up Docker Buildx
121+
id: buildx
122+
uses: crazy-max/ghaction-docker-buildx@v3
123+
with:
124+
buildx-version: latest
125+
qemu-version: latest
119126
- run: mkdir ./docker-image/
120127
- run: ./build-php.sh $(echo "${{ matrix.image }}" | tr '-' ' ')
121128
- run: cat ./docker-image/image.tags | xargs -I % docker inspect --format='%={{.Id}}:{{index .Config.Env 7}}' %

build-php.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ docker pull "php:${IMAGE_TAG}"
4646

4747
for buildTarget in "${target[@]}"
4848
do
49-
sed -E "s/${IMAGE_ORIGINAL_TAG}/${IMAGE_TAG}/g" "Dockerfile-${DST_IMAGE}-${OS}" | docker build --label org.label-schema.build-date=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --label org.label-schema.vcs-ref=`git rev-parse --short HEAD` -t "${WYRIHAXIMUSNET_TAG}${buildTarget}" --target="${DST_IMAGE}${buildTarget}" -f - .
49+
sed -E "s/${IMAGE_ORIGINAL_TAG}/${IMAGE_TAG}/g" "Dockerfile-${DST_IMAGE}-${OS}" | docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" --output "type=docker" --pull --label org.label-schema.build-date=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --label org.label-schema.vcs-ref=`git rev-parse --short HEAD` -t "${WYRIHAXIMUSNET_TAG}${buildTarget}" --target="${DST_IMAGE}${buildTarget}" -f - .
5050
echo "${WYRIHAXIMUSNET_TAG}${buildTarget}" >> "$TAG_FILE"
5151
done

0 commit comments

Comments
 (0)