From 73c79f9073a5f8b5812aacff934d0d4d49be3856 Mon Sep 17 00:00:00 2001 From: Andrew Paglusch Date: Wed, 14 Feb 2024 15:35:08 -0600 Subject: [PATCH] fix multi-arch builds --- .github/workflows/docker_publish.yml | 21 ++++++++++++--------- README.md | 4 +--- docker/arm.Dockerfile | 24 ------------------------ 3 files changed, 13 insertions(+), 36 deletions(-) delete mode 100644 docker/arm.Dockerfile diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index 7225c71..62774cf 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -30,13 +30,6 @@ jobs: # This is used to complete the identity challenge # with sigstore/fulcio when running outside of PRs. id-token: write - strategy: - matrix: - include: - - dockerfile: Dockerfile - platform: linux/amd64 - - dockerfile: arm.Dockerfile - platform: linux/arm64/v8 steps: - name: Checkout repository @@ -69,6 +62,12 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern=v{{major}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image @@ -76,8 +75,12 @@ jobs: uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 with: context: . - file: docker/${{ matrix.dockerfile }} + file: docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - platforms: ${{ matrix.platform }} + platforms: + - linux/amd64 + - linux/arm64 + - linux/arm/v6 + - linux/arm/v7 diff --git a/README.md b/README.md index e4fdbfc..8dde3f8 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,7 @@ https://flashpaper.io 4. Set up a reverse-proxy in front of FlashPaper that terminates SSL/TLS #### Building an Image - You can build your own image using the provided Dockerfile in the `docker/` folder. There are currently two: - - For x86_64 (`docker/Dockerfile`) - - For ARM64 (`docker/arm.Dockerfile`) + You can build your own image using the provided Dockerfile in the `docker/` folder. In order to build FlashPaper, run `docker build . -t flashpaper -f docker/Dockerfile`. If you would like to build FlashPaper for a different CPU architecture, replace `docker/Dockerfile` with the appropriate Dockerfile. You can also build via docker-compose by replacing the `image:` line in [docker-compose.yml](https://github.com/AndrewPaglusch/FlashPaper/blob/master/docker-compose.yml) with the following (make sure to choose the Dockerfile for your architecture): diff --git a/docker/arm.Dockerfile b/docker/arm.Dockerfile deleted file mode 100644 index 1ada524..0000000 --- a/docker/arm.Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM arm64v8/alpine:3.18.2 - -# To reduce duplication -ENV PHP_VER=php81 - -RUN apk add --no-cache gettext curl nginx $PHP_VER $PHP_VER-fpm $PHP_VER-opcache $PHP_VER-pdo $PHP_VER-pdo_sqlite $PHP_VER-openssl && \ - mkdir /var/www/html - -COPY . /var/www/html - -RUN chmod -R 775 /var/www/html && \ - chown -R nginx:nginx /var/www/html - -COPY docker/php-fpm.conf /etc/$PHP_VER/php-fpm.conf -COPY docker/nginx.conf /etc/nginx/nginx.conf -COPY docker/entrypoint.sh /entrypoint.sh - -RUN mkdir -p /var/run/nginx && \ - mkdir -p /var/run/php-fpm && \ - chown -R nginx:nginx /var/run/ && \ - chmod +x /entrypoint.sh -VOLUME /var/www/html/data - -ENTRYPOINT ["/bin/ash", "/entrypoint.sh"]