Skip to content

Commit ae216f9

Browse files
committed
Support build arm64 for base images.
1 parent addbbb6 commit ae216f9

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

.github/workflows/build-base.yml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
required: true
1010
default: ''
1111

12-
env:
13-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
14-
1512
jobs:
1613
build:
1714
name: Build Base Image
@@ -41,14 +38,35 @@ jobs:
4138
steps:
4239
- name: Checkout code
4340
uses: actions/checkout@v3
44-
- name: Build
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v3
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
- name: Login to Docker Hub
46+
uses: docker/login-action@v3
47+
with:
48+
username: limingxinleo
49+
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
50+
- name: Build and export to Docker
51+
uses: docker/build-push-action@v5
52+
with:
53+
context: ${{ matrix.php-version }}/alpine/base
54+
load: true
55+
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
56+
build-args: |
57+
"ALPINE_VERSION=${{ matrix.alpine-version }}"
58+
- name: Check
4559
run: |
46-
docker-compose build alpine-base
4760
docker run --entrypoint php -v $PWD/tests/base:/opt/www hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base /opt/www/openssl.php
48-
- name: Push Images to Docker Hub
61+
- name: Push
4962
if: ${{ github.event.inputs.event == 'publish' }}
50-
run: |
51-
docker login --username limingxinleo -p $DOCKERHUB_TOKEN
52-
docker push hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
63+
uses: docker/build-push-action@v5
64+
with:
65+
context: ${{ matrix.php-version }}/alpine/base
66+
push: true
67+
platforms: linux/amd64,linux/arm64
68+
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
69+
build-args: |
70+
"ALPINE_VERSION=${{ matrix.alpine-version }}"
5371
5472

0 commit comments

Comments
 (0)