Skip to content

Commit

Permalink
Support build arm64 for base images.
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Jun 17, 2024
1 parent addbbb6 commit ae216f9
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
required: true
default: ''

env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}

jobs:
build:
name: Build Base Image
Expand Down Expand Up @@ -41,14 +38,35 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: limingxinleo
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: ${{ matrix.php-version }}/alpine/base
load: true
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
build-args: |
"ALPINE_VERSION=${{ matrix.alpine-version }}"
- name: Check
run: |
docker-compose build alpine-base
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
- name: Push Images to Docker Hub
- name: Push
if: ${{ github.event.inputs.event == 'publish' }}
run: |
docker login --username limingxinleo -p $DOCKERHUB_TOKEN
docker push hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
uses: docker/build-push-action@v5
with:
context: ${{ matrix.php-version }}/alpine/base
push: true
platforms: linux/amd64,linux/arm64
tags: hyperf/hyperf:${{ matrix.php-version }}-alpine-v${{ matrix.alpine-version }}-base
build-args: |
"ALPINE_VERSION=${{ matrix.alpine-version }}"

0 comments on commit ae216f9

Please sign in to comment.