From 89aebfd0143d086e2a90654feb11863c7c1b0729 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Thu, 10 Mar 2022 20:35:32 +0100 Subject: [PATCH] testing if sharp can build on alpine all platforms --- .github/workflows/build.yml | 22 ++++++++++------------ docker/alpine/Dockerfile.build | 11 ++++++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40cd36fe..a7a2b793 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,7 +92,7 @@ jobs: needs: [ create-release ] strategy: matrix: - container: [ alpine, debian-stretch ] + container: [ debian-stretch ] steps: - name: Set tag @@ -113,14 +113,13 @@ jobs: with: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Test build on Pull request and test branches - if: ${{ startsWith(steps.vars.outputs.type , 'head') && ((github.event.issue.pull_request && github.ref == 'refs/heads/master') || github.ref != 'refs/heads/master') }} + - name: Build docker uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build platforms: linux/amd64,linux/arm64 - - name: Build experimental + - name: Push experimental if: ${{ github.ref == 'refs/heads/experimental' }} uses: docker/build-push-action@v2 with: @@ -129,7 +128,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - - name: Build and push nightly on new master commit + - name: Push nightly on new master commit if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: @@ -138,7 +137,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - - name: Build and push release on new Tag + - name: Push release on new Tag if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request }} uses: docker/build-push-action@v2 with: @@ -155,7 +154,7 @@ jobs: needs: [ create-release ] strategy: matrix: - container: [ debian-buster ] + container: [alpine, debian-buster ] steps: - name: Set tag @@ -176,14 +175,13 @@ jobs: with: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Test build on Pull request and test branches - if: ${{ startsWith(steps.vars.outputs.type , 'head') && ((github.event.issue.pull_request && github.ref == 'refs/heads/master') || github.ref != 'refs/heads/master') }} + - name: Build docker uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build platforms: linux/amd64,linux/arm64,linux/arm/v7 - - name: Build experimental + - name: Push experimental if: ${{ github.ref == 'refs/heads/experimental' }} uses: docker/build-push-action@v2 with: @@ -192,7 +190,7 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - - name: Build and push nightly on new master commit + - name: Push nightly on new master commit if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: @@ -201,7 +199,7 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - - name: Build and push release on new Tag + - name: Push release on new Tag if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request }} uses: docker/build-push-action@v2 with: diff --git a/docker/alpine/Dockerfile.build b/docker/alpine/Dockerfile.build index 6f2ee2f6..0d395390 100644 --- a/docker/alpine/Dockerfile.build +++ b/docker/alpine/Dockerfile.build @@ -2,7 +2,10 @@ #----------------------------------------- FROM node:14-alpine3.15 AS builder RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ \ - python3 build-base sqlite-dev sqlite-libs vips-dev vips fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python + python3 build-base sqlite-dev sqlite-libs fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python \ + +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ vips-dev>8.12.2-r3 vips>8.12.2-r3 + COPY pigallery2-release /app WORKDIR /app RUN npm install --unsafe-perm @@ -25,8 +28,10 @@ ENV NODE_ENV=production \ PI_DOCKER=true EXPOSE 80 -RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ \ - vips ffmpeg +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ ffmpeg +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ vips>8.12.2-r3 + + COPY --from=builder /app /app VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"] HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \