From 663bf2f03bb97aa1c9420a477a2942ee70a0d326 Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Wed, 5 Apr 2023 14:28:38 +0200 Subject: [PATCH] Add ARM build in GitHub Actions - Hint: Tried to use the plattform parameter of the build-push-action, however this failed with an error in the Jobs. Therefore, I used a matrix with the platforms. - The ARM build takes a long time. --- .../build-latest-container-images.yaml | 18 +++++++++++++++--- .../workflows/build-lts-container-images.yaml | 18 +++++++++++++++--- .../test-latest-container-images.yaml | 13 +++++++++++-- .../workflows/test-lts-container-images.yaml | 7 +++++-- tests/apache-tests.yaml | 3 --- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-latest-container-images.yaml b/.github/workflows/build-latest-container-images.yaml index 61c0a21..e956f67 100644 --- a/.github/workflows/build-latest-container-images.yaml +++ b/.github/workflows/build-latest-container-images.yaml @@ -15,7 +15,7 @@ jobs: - 6.0/fpm-alpine/Dockerfile - 6.0/fpm/Dockerfile steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hadolint/hadolint-action@v1.5.0 with: dockerfile: ${{ matrix.dockerfile }} @@ -29,11 +29,20 @@ jobs: permissions: packages: write contents: read + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 steps: - name: 'Check out the repo' - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: 'Set up QEMU' + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' - name: 'Set up Docker Buildx' - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: --debug - name: 'Log in to DockerHub' @@ -61,6 +70,7 @@ jobs: push: true tags: ${{ steps.metadata-apache.outputs.tags }} labels: ${{ steps.metadata-apache.outputs.labels }} + platforms: ${{ matrix.platform }} - name: 'FPM variant metadata' id: metadata-fpm @@ -81,6 +91,7 @@ jobs: push: true tags: ${{ steps.metadata-fpm.outputs.tags }} labels: ${{ steps.metadata-fpm.outputs.labels }} + platforms: ${{ matrix.platform }} - name: 'FPM Alpine variant metadata' id: metadata-fpm-alpine @@ -101,3 +112,4 @@ jobs: push: true tags: ${{ steps.metadata-fpm-alpine.outputs.tags }} labels: ${{ steps.metadata-fpm-alpine.outputs.labels }} + platforms: ${{ matrix.platform }} diff --git a/.github/workflows/build-lts-container-images.yaml b/.github/workflows/build-lts-container-images.yaml index 5f89a98..f74defd 100644 --- a/.github/workflows/build-lts-container-images.yaml +++ b/.github/workflows/build-lts-container-images.yaml @@ -15,7 +15,7 @@ jobs: - 5.0/fpm-alpine/Dockerfile - 5.0/fpm/Dockerfile steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hadolint/hadolint-action@v1.5.0 with: dockerfile: ${{ matrix.dockerfile }} @@ -29,11 +29,20 @@ jobs: permissions: packages: write contents: read + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 steps: - name: 'Check out the repo' - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: 'Set up QEMU' + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' - name: 'Set up Docker Buildx' - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 with: buildkitd-flags: --debug - name: 'Log in to DockerHub' @@ -61,6 +70,7 @@ jobs: push: true tags: ${{ steps.metadata-apache.outputs.tags }} labels: ${{ steps.metadata-apache.outputs.labels }} + platforms: ${{ matrix.platform }} - name: 'FPM variant metadata' id: metadata-fpm @@ -81,6 +91,7 @@ jobs: push: true tags: ${{ steps.metadata-fpm.outputs.tags }} labels: ${{ steps.metadata-apache.outputs.labels }} + platforms: ${{ matrix.platform }} - name: 'FPM Alpine variant metadata' id: metadata-fpm-alpine @@ -101,3 +112,4 @@ jobs: push: true tags: ${{ steps.metadata-fpm-alpine.outputs.tags }} labels: ${{ steps.metadata-apache.outputs.labels }} + platforms: ${{ matrix.platform }} diff --git a/.github/workflows/test-latest-container-images.yaml b/.github/workflows/test-latest-container-images.yaml index 6cab0ad..98d892e 100644 --- a/.github/workflows/test-latest-container-images.yaml +++ b/.github/workflows/test-latest-container-images.yaml @@ -12,12 +12,20 @@ jobs: - apache - fpm-alpine - fpm + platform: + - linux/amd64 + - linux/arm64 steps: - name: 'Check out the repo' - uses: actions/checkout@v2 + uses: actions/checkout@v3 + + - name: 'Set up QEMU' + uses: docker/setup-qemu-action@v2 + with: + platforms: 'arm64,arm' - name: 'Set up Docker Buildx' - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: 'Build Container images' uses: docker/build-push-action@v2 @@ -26,6 +34,7 @@ jobs: push: false load: true tags: docker.io/martialblog/limesurvey:6-${{ matrix.context }} + platforms: ${{ matrix.platform }} - name: 'Run Structure tests' uses: plexsystems/container-structure-test-action@v0.2.0 diff --git a/.github/workflows/test-lts-container-images.yaml b/.github/workflows/test-lts-container-images.yaml index 98936aa..11dc794 100644 --- a/.github/workflows/test-lts-container-images.yaml +++ b/.github/workflows/test-lts-container-images.yaml @@ -14,10 +14,13 @@ jobs: - fpm steps: - name: 'Check out the repo' - uses: actions/checkout@v2 + uses: actions/checkout@v3 + + - name: 'Set up QEMU' + uses: docker/setup-qemu-action@v2 - name: 'Set up Docker Buildx' - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: 'Build Container images' uses: docker/build-push-action@v2 diff --git a/tests/apache-tests.yaml b/tests/apache-tests.yaml index 7b034dd..9a4ccf0 100644 --- a/tests/apache-tests.yaml +++ b/tests/apache-tests.yaml @@ -21,9 +21,6 @@ fileExistenceTests: path: '/var/www/html/admin/index.php' shouldExist: true permissions: '-rw-rw-r--' - - name: 'Ldap syslink' - path: '/usr/lib/x86_64-linux-gnu/libldap.so' - shouldExist: true - name: "Dependencies - PHP - gd" path: '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' shouldExist: true