From 3db16b9a0f258d0424a69cd79838da2983ea317a Mon Sep 17 00:00:00 2001 From: GilbN Date: Thu, 31 Mar 2022 20:54:30 +0200 Subject: [PATCH 01/14] testing --- .github/workflows/docker-build.yml | 76 ++++++++++-------------------- Dockerfile | 4 +- 2 files changed, 27 insertions(+), 53 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 155a1d17..151f08ab 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -10,13 +10,12 @@ on: required: true type: choice options: - - master - - develop + - testing tag: description: 'Add a tag' push: branches: - - develop + - testing paths-ignore: - '.github/**' jobs: @@ -33,58 +32,33 @@ jobs: - name: Set current date as env variable id: date_time run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Docker meta + id: metadata # you'll use this in the next step + uses: docker/metadata-action@v3 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/gilbn/theme.park + # Docker tags based on the following events/attributes + tags: | + testing - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_PAT }} - - name: build&push master - if: ${{ github.event.release.target_commitish == 'master' }} - run: | - docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} . - docker push --all-tags ghcr.io/gilbn/theme.park - - name: manual build&push master - if: ${{ github.event.inputs.branch == 'master' }} - run: | - docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.tag }} . - docker push --all-tags ghcr.io/gilbn/theme.park - - name: build&push develop - if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} - run: | - docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park:develop . - docker push --all-tags ghcr.io/gilbn/theme.park - push_to_dockerhub: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }} - - name: Set current date as env variable - id: date_time - run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') - - name: Login to Docker Hub - uses: docker/login-action@v1 + - name: build&push testing + if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} + uses: docker/build-push-action@v2 with: - username: ${{ secrets.DH_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build&push dh master - if: ${{ github.event.release.target_commitish == 'master' }} - run: | - docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} . - docker push --all-tags gilbn/theme.park - - name: manual build&push dh master - if: ${{ github.event.inputs.branch == 'master' }} - run: | - docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ github.event.inputs.tag }} . - docker push --all-tags gilbn/theme.park - - name: build&push dh develop - if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} - run: | - docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop . - docker push --all-tags gilbn/theme.park - + context: . + platforms: linux/amd64,linux/arm/v8 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index c8bc0f11..47509e13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 +FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" LABEL maintainer="gilbn" RUN \ From 35023ce113883ee4303b19c90e46d8085ef00098 Mon Sep 17 00:00:00 2001 From: GilbN Date: Thu, 31 Mar 2022 21:06:37 +0200 Subject: [PATCH 02/14] testing --- .github/workflows/docker-build.yml | 2 +- Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 151f08ab..466cf8a5 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -58,7 +58,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64,linux/arm/v8 + platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 47509e13..b1f977e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ARG BUILD_DATE ARG TP_RELEASE LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" LABEL maintainer="gilbn" +LABEL org.opencontainers.image.description DESCRIPTION RUN \ echo " ## Installing packages ## " && \ From 13f1550d900ee00ef72886c5504a6f80f37cd3d8 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 15:15:18 +0200 Subject: [PATCH 03/14] workflow update --- .github/workflows/docker-build.yml | 62 ++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 466cf8a5..996ea765 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -10,16 +10,19 @@ on: required: true type: choice options: + - master + - develop - testing tag: description: 'Add a tag' push: branches: + - develop - testing paths-ignore: - '.github/**' jobs: - push_to_ghcr_io: + build-and-push-it-to-the-limit: runs-on: ubuntu-latest steps: - name: checkout @@ -29,36 +32,81 @@ jobs: - name: Get the version id: get_version run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }} + - name: Set current date as env variable id: date_time run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') + - name: Set up QEMU uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 + - name: Docker meta - id: metadata # you'll use this in the next step + id: metadata uses: docker/metadata-action@v3 with: - # list of Docker images to use as base name for tags images: | ghcr.io/gilbn/theme.park - # Docker tags based on the following events/attributes + gilbn/theme.park tags: | - testing + type=ref,event=branch + - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GH_PAT }} + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DH_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: build&push master + if: ${{ github.event.release.target_commitish == 'master' }} + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }}, latest, latest-${{ runner.arch }} + labels: ${{ steps.metadata.outputs.labels }} + build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + + - name: manual build&push master + if: ${{ github.event.inputs.branch == 'master' }} + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }}, latest, ${{ github.event.inputs.tag }}, latest-${{ runner.arch }} + labels: ${{ steps.metadata.outputs.labels }} + build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + + - name: build&push develop + if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm/v7,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.metadata.outputs.tags }}, develop-${{ runner.arch }} + labels: ${{ steps.metadata.outputs.labels }} + build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + - name: build&push testing if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 + platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }} + tags: ${{ steps.metadata.outputs.tags }}, testing-${{ runner.arch }} labels: ${{ steps.metadata.outputs.labels }} + build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} From ae9a8f30b5d13db33ddc9c5a8e2d6ba6e1af44e2 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 15:44:56 +0200 Subject: [PATCH 04/14] tag fix --- .github/workflows/docker-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 996ea765..8a6875a6 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -74,7 +74,7 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }}, latest, latest-${{ runner.arch }} + tags: latest labels: ${{ steps.metadata.outputs.labels }} build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} @@ -85,7 +85,7 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }}, latest, ${{ github.event.inputs.tag }}, latest-${{ runner.arch }} + tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} @@ -96,7 +96,7 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }}, develop-${{ runner.arch }} + tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} @@ -107,6 +107,6 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }}, testing-${{ runner.arch }} + tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} From 071f0af975d58814bc6d000b99a3eecc6c77ad07 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 18:40:11 +0200 Subject: [PATCH 05/14] test --- .github/workflows/docker-build.yml | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 8a6875a6..a26ddc6d 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -74,7 +74,7 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: latest + tags: latest, ${{ steps.get_version.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} @@ -105,7 +105,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + platforms: amd64,arm32v7,arm64v8 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index b1f977e7..a1434412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:${BUILDPLATFORM}-3.14 # set version label ARG BUILD_DATE From cacac7385ab9bd958665b9303b50990cceb4d193 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 19:07:32 +0200 Subject: [PATCH 06/14] hmm --- .github/workflows/docker-build.yml | 26 ++++++++++++++++---------- Dockerfile | 2 +- Dockerfile.aarch64 | 23 +++++++++++++++++++++++ Dockerfile.armhf | 23 +++++++++++++++++++++++ 4 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 Dockerfile.aarch64 create mode 100644 Dockerfile.armhf diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index a26ddc6d..d334af97 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -24,14 +24,20 @@ on: jobs: build-and-push-it-to-the-limit: runs-on: ubuntu-latest + strategy: + matrix: + architecture: [armhf, aarch64, amd64] steps: - name: checkout uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }} + - name: Prepare + id: prep + run: | + ARCHITECTURE=${{ matrix.architecture }} + echo ::set-output name=VERSION::${{ github.event.release.tag_name }} + echo ::set-output name=platform::${ARCHITECTURE//-/\/} - name: Set current date as env variable id: date_time @@ -74,9 +80,9 @@ jobs: context: . platforms: linux/amd64,linux/arm/v7,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: latest, ${{ steps.get_version.outputs.VERSION }} + tags: latest, ${{ steps.prep.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} - name: manual build&push master if: ${{ github.event.inputs.branch == 'master' }} @@ -87,7 +93,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} - name: build&push develop if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} @@ -98,15 +104,15 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} - name: build&push testing if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} uses: docker/build-push-action@v2 with: - context: . - platforms: amd64,arm32v7,arm64v8 + file: ./${{ matrix.architecture }}.Dockerfile + platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} diff --git a/Dockerfile b/Dockerfile index a1434412..bd3c4ed5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:${BUILDPLATFORM}-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 # set version label ARG BUILD_DATE diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 00000000..4c28392c --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,23 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 + +# set version label +ARG BUILD_DATE +ARG TP_RELEASE +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" +LABEL maintainer="gilbn" +LABEL org.opencontainers.image.description DESCRIPTION + +RUN \ +echo " ## Installing packages ## " && \ +apk add --no-cache --virtual=build-dependencies \ + python3 && \ + echo "**** install theme.park ****" && \ + mkdir -p /app/themepark + +# copy local files +WORKDIR /app +COPY css/ /app/themepark/css/ +COPY resources/ /app/themepark/resources/ +COPY themes.py index.html CNAME /app/themepark/ + +COPY docker/root/ / \ No newline at end of file diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 00000000..9a20b507 --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,23 @@ +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 + +# set version label +ARG BUILD_DATE +ARG TP_RELEASE +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" +LABEL maintainer="gilbn" +LABEL org.opencontainers.image.description DESCRIPTION + +RUN \ +echo " ## Installing packages ## " && \ +apk add --no-cache --virtual=build-dependencies \ + python3 && \ + echo "**** install theme.park ****" && \ + mkdir -p /app/themepark + +# copy local files +WORKDIR /app +COPY css/ /app/themepark/css/ +COPY resources/ /app/themepark/resources/ +COPY themes.py index.html CNAME /app/themepark/ + +COPY docker/root/ / \ No newline at end of file From 642b9db799e35a0cf7f1145c99a56b7d5099f454 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 19:10:05 +0200 Subject: [PATCH 07/14] path fix --- .github/workflows/docker-build.yml | 2 +- Dockerfile => Dockerfile.amd64 | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename Dockerfile => Dockerfile.amd64 (100%) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d334af97..57100ec2 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -110,7 +110,7 @@ jobs: if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} uses: docker/build-push-action@v2 with: - file: ./${{ matrix.architecture }}.Dockerfile + file: ./Dockerfile.${{ matrix.architecture }} platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} diff --git a/Dockerfile b/Dockerfile.amd64 similarity index 100% rename from Dockerfile rename to Dockerfile.amd64 From 12be2dd79535b6d0bf9b0fe471a8eb7fe6279f25 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 19:47:25 +0200 Subject: [PATCH 08/14] take 2 --- .github/workflows/docker-build.yml | 19 +++++++++---------- Dockerfile.aarch64 | 4 ++-- Dockerfile.amd64 | 4 ++-- Dockerfile.armhf | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 57100ec2..521f6238 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -37,8 +37,7 @@ jobs: run: | ARCHITECTURE=${{ matrix.architecture }} echo ::set-output name=VERSION::${{ github.event.release.tag_name }} - echo ::set-output name=platform::${ARCHITECTURE//-/\/} - + echo ::set-output name=platform::${ARCHITECTURE} - name: Set current date as env variable id: date_time run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') @@ -77,8 +76,8 @@ jobs: if: ${{ github.event.release.target_commitish == 'master' }} uses: docker/build-push-action@v2 with: - context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + file: ./Dockerfile.${{ matrix.architecture }} + platforms: ${{ matrix.architecture } push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ steps.prep.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} @@ -88,8 +87,8 @@ jobs: if: ${{ github.event.inputs.branch == 'master' }} uses: docker/build-push-action@v2 with: - context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + file: ./Dockerfile.${{ matrix.architecture }} + platforms: ${{ matrix.architecture } push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} @@ -99,8 +98,8 @@ jobs: if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} uses: docker/build-push-action@v2 with: - context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + file: ./Dockerfile.${{ matrix.architecture }} + platforms: ${{ matrix.architecture } push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} @@ -111,8 +110,8 @@ jobs: uses: docker/build-push-action@v2 with: file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ steps.prep.outputs.platform }} + platforms: ${{ matrix.architecture } push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}, PLATFORM=${{ steps.prep.outputs.platform }} diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 4c28392c..d1dd2f0e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 +FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index bd3c4ed5..d62c35f7 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 +FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 9a20b507..10574560 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 +FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION From ed8863b21c292be35185566d088f7856f049f800 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 19:48:41 +0200 Subject: [PATCH 09/14] take 3 --- .github/workflows/docker-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 521f6238..7160ae1a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -77,7 +77,7 @@ jobs: uses: docker/build-push-action@v2 with: file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture } + platforms: ${{ matrix.architecture }} push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ steps.prep.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} @@ -88,7 +88,7 @@ jobs: uses: docker/build-push-action@v2 with: file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture } + platforms: ${{ matrix.architecture }} push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} @@ -99,7 +99,7 @@ jobs: uses: docker/build-push-action@v2 with: file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture } + platforms: ${{ matrix.architecture }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} @@ -110,7 +110,7 @@ jobs: uses: docker/build-push-action@v2 with: file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture } + platforms: ${{ matrix.architecture }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} From 2eb569cc593c1635805137e015c62b489b48bd5c Mon Sep 17 00:00:00 2001 From: GilbN Date: Sat, 2 Apr 2022 20:29:25 +0200 Subject: [PATCH 10/14] take 3 --- .github/workflows/docker-build.yml | 20 ++++++++++---------- Dockerfile.amd64 => linux-amd64.Dockerfile | 2 +- Dockerfile.armhf => linux-arm-v7.Dockerfile | 2 +- Dockerfile.aarch64 => linux-arm64.Dockerfile | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) rename Dockerfile.amd64 => linux-amd64.Dockerfile (84%) rename Dockerfile.armhf => linux-arm-v7.Dockerfile (84%) rename Dockerfile.aarch64 => linux-arm64.Dockerfile (84%) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 7160ae1a..6a4d839a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - architecture: [armhf, aarch64, amd64] + architecture: [linux-arm-v7,linux-arm64, linux-amd64] steps: - name: checkout uses: actions/checkout@v2 @@ -37,7 +37,7 @@ jobs: run: | ARCHITECTURE=${{ matrix.architecture }} echo ::set-output name=VERSION::${{ github.event.release.tag_name }} - echo ::set-output name=platform::${ARCHITECTURE} + echo ::set-output name=platform::${ARCHITECTURE//-/\/} - name: Set current date as env variable id: date_time run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') @@ -76,8 +76,8 @@ jobs: if: ${{ github.event.release.target_commitish == 'master' }} uses: docker/build-push-action@v2 with: - file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture }} + file: ./${{ matrix.architecture }}.Dockerfile + platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ steps.prep.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} @@ -87,8 +87,8 @@ jobs: if: ${{ github.event.inputs.branch == 'master' }} uses: docker/build-push-action@v2 with: - file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture }} + file: ./${{ matrix.architecture }}.Dockerfile + platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} @@ -98,8 +98,8 @@ jobs: if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} uses: docker/build-push-action@v2 with: - file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture }} + file: ./${{ matrix.architecture }}.Dockerfile + platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} @@ -109,8 +109,8 @@ jobs: if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} uses: docker/build-push-action@v2 with: - file: ./Dockerfile.${{ matrix.architecture }} - platforms: ${{ matrix.architecture }} + file: ./${{ matrix.architecture }}.Dockerfile + platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} diff --git a/Dockerfile.amd64 b/linux-amd64.Dockerfile similarity index 84% rename from Dockerfile.amd64 rename to linux-amd64.Dockerfile index d62c35f7..5d81cd76 100644 --- a/Dockerfile.amd64 +++ b/linux-amd64.Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 # set version label ARG BUILD_DATE diff --git a/Dockerfile.armhf b/linux-arm-v7.Dockerfile similarity index 84% rename from Dockerfile.armhf rename to linux-arm-v7.Dockerfile index 10574560..94b02f71 100644 --- a/Dockerfile.armhf +++ b/linux-arm-v7.Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 # set version label ARG BUILD_DATE diff --git a/Dockerfile.aarch64 b/linux-arm64.Dockerfile similarity index 84% rename from Dockerfile.aarch64 rename to linux-arm64.Dockerfile index d1dd2f0e..0cdaa82b 100644 --- a/Dockerfile.aarch64 +++ b/linux-arm64.Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 # set version label ARG BUILD_DATE From 98ccf7c98d2cee81e24c2d8b23bc2be7f49bccf9 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 3 Apr 2022 12:48:26 +0200 Subject: [PATCH 11/14] manifest festivities --- .github/workflows/docker-build.yml | 95 +++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6a4d839a..1273173b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -19,14 +19,13 @@ on: branches: - develop - testing - paths-ignore: - - '.github/**' + jobs: build-and-push-it-to-the-limit: runs-on: ubuntu-latest strategy: matrix: - architecture: [linux-arm-v7,linux-arm64, linux-amd64] + architecture: [linux-arm-v7,linux-arm64,linux-amd64] steps: - name: checkout uses: actions/checkout@v2 @@ -36,11 +35,16 @@ jobs: id: prep run: | ARCHITECTURE=${{ matrix.architecture }} + echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + echo ::set-output name=title::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//} + echo ::set-output name=revision::${GITHUB_SHA} + echo ::set-output name=source::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/tree/${GITHUB_REF//refs\/heads\//} + echo ::set-output name=vendor::${{ github.repository_owner }} + echo ::set-output name=url::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/blob/master/README.md echo ::set-output name=VERSION::${{ github.event.release.tag_name }} echo ::set-output name=platform::${ARCHITECTURE//-/\/} - - name: Set current date as env variable - id: date_time - run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') + echo ::set-output name=cache::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//}-cache-${{ matrix.architecture }} + echo ::set-output name=tag::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}-${{ matrix.architecture }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -81,7 +85,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ steps.prep.outputs.VERSION }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - name: manual build&push master if: ${{ github.event.inputs.branch == 'master' }} @@ -92,7 +96,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: latest, ${{ github.event.inputs.tag }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - name: build&push develop if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} @@ -103,15 +107,78 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }} + build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - name: build&push testing if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} uses: docker/build-push-action@v2 with: - file: ./${{ matrix.architecture }}.Dockerfile - platforms: ${{ steps.prep.outputs.platform }} push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}, PLATFORM=${{ steps.prep.outputs.platform }} + platforms: ${{ steps.prep.outputs.platform }} + file: ./${{ matrix.architecture }}.Dockerfile + cache-from: docker.io/${{ steps.prep.outputs.cache }} + cache-to: docker.io/${{ steps.prep.outputs.cache }} + tags: | + docker.io/${{ steps.prep.outputs.tag }} + ghcr.io/${{ steps.prep.outputs.tag }} + labels: | + org.opencontainers.image.created=${{ steps.prep.outputs.created }} + org.opencontainers.image.title=${{ steps.prep.outputs.title }} + org.opencontainers.image.revision=${{ steps.prep.outputs.revision }} + org.opencontainers.image.source=${{ steps.prep.outputs.source }} + org.opencontainers.image.vendor=${{ steps.prep.outputs.vendor }} + org.opencontainers.image.url=${{ steps.prep.outputs.url }} + org.opencontainers.image.version=${{ steps.prep.outputs.version }} + build-args: | + TP_RELEASE=${{ steps.prep.outputs.VERSION }} + BUILD_DATE=${{ steps.date_time.outputs.created }} + BUILD_ARCHITECTURE=${{ matrix.architecture }} + + publish: + runs-on: ubuntu-20.04 + strategy: + matrix: + registry: [docker.io, ghcr.io] + needs: [build-and-push-it-to-the-limit] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to DockerHub + if: matrix.registry == 'docker.io' + uses: docker/login-action@v1 + with: + registry: docker.io + username: ${{ secrets.DH_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + if: matrix.registry == 'ghcr.io' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GH_PAT }} + + - name: Create manifests + env: + DOCKER_CLI_EXPERIMENTAL: enabled + run: | + IMAGE=${{ matrix.registry }}/${GITHUB_REPOSITORY} + TAG=${GITHUB_REF//refs\/heads\//} + SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER} + VERSION=${{ steps.prep.outputs.VERSION }} + + [[ -f linux-amd64.Dockerfile ]] && AMD64=${SOURCE}-linux-amd64 + [[ -f linux-arm64.Dockerfile ]] && ARM64=${SOURCE}-linux-arm64 + [[ -f linux-arm-v7.Dockerfile ]] && ARMV7=${SOURCE}-linux-arm-v7 + docker manifest create ${IMAGE}:${TAG} ${AMD64} ${ARM64} ${ARMV7} + docker manifest push ${IMAGE}:${TAG} + docker manifest create ${IMAGE}:${TAG}-${VERSION//\~/-} ${AMD64} ${ARM64} ${ARMV7} + docker manifest push ${IMAGE}:${TAG}-${VERSION//\~/-} + docker manifest create ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} ${AMD64} ${ARM64} ${ARMV7} + docker manifest push ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} + if [[ ${TAG} == master ]]; then + docker manifest create ${IMAGE}:latest ${AMD64} ${ARM64} ${ARMV7} + docker manifest push ${IMAGE}:latest + fi \ No newline at end of file From 61db6cedaf5b53d80ab44055e5d41ecfa04a6f65 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 3 Apr 2022 12:53:40 +0200 Subject: [PATCH 12/14] casing --- .github/workflows/docker-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1273173b..aec82731 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -36,15 +36,15 @@ jobs: run: | ARCHITECTURE=${{ matrix.architecture }} echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - echo ::set-output name=title::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//} + echo ::set-output name=title::${GITHUB_REPOSITORY,,}:${GITHUB_REF//refs\/heads\//} echo ::set-output name=revision::${GITHUB_SHA} - echo ::set-output name=source::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/tree/${GITHUB_REF//refs\/heads\//} + echo ::set-output name=source::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/tree/${GITHUB_REF//refs\/heads\//} echo ::set-output name=vendor::${{ github.repository_owner }} - echo ::set-output name=url::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/blob/master/README.md + echo ::set-output name=url::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/blob/master/README.md echo ::set-output name=VERSION::${{ github.event.release.tag_name }} echo ::set-output name=platform::${ARCHITECTURE//-/\/} - echo ::set-output name=cache::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//}-cache-${{ matrix.architecture }} - echo ::set-output name=tag::${GITHUB_REPOSITORY}:${GITHUB_REF//refs\/heads\//}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}-${{ matrix.architecture }} + echo ::set-output name=cache::${GITHUB_REPOSITORY,,}:${GITHUB_REF//refs\/heads\//}-cache-${{ matrix.architecture }} + echo ::set-output name=tag::${GITHUB_REPOSITORY,,}:${GITHUB_REF//refs\/heads\//}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}-${{ matrix.architecture }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -164,7 +164,7 @@ jobs: env: DOCKER_CLI_EXPERIMENTAL: enabled run: | - IMAGE=${{ matrix.registry }}/${GITHUB_REPOSITORY} + IMAGE=${{ matrix.registry }}/${GITHUB_REPOSITORY,,} TAG=${GITHUB_REF//refs\/heads\//} SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER} VERSION=${{ steps.prep.outputs.VERSION }} From ea61c9cd014a27a8e765b093a9419ba9d2788e52 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 3 Apr 2022 15:10:26 +0200 Subject: [PATCH 13/14] build from the correct base... --- .github/workflows/docker-build.yml | 51 +++--------------------------- linux-amd64.Dockerfile | 2 +- linux-arm-v7.Dockerfile | 4 +-- linux-arm64.Dockerfile | 4 +-- 4 files changed, 9 insertions(+), 52 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index aec82731..4b183387 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -53,16 +53,6 @@ jobs: id: buildx uses: docker/setup-buildx-action@v1 - - name: Docker meta - id: metadata - uses: docker/metadata-action@v3 - with: - images: | - ghcr.io/gilbn/theme.park - gilbn/theme.park - tags: | - type=ref,event=branch - - name: Login to GitHub Container Registry uses: docker/login-action@v1 with: @@ -76,41 +66,7 @@ jobs: username: ${{ secrets.DH_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: build&push master - if: ${{ github.event.release.target_commitish == 'master' }} - uses: docker/build-push-action@v2 - with: - file: ./${{ matrix.architecture }}.Dockerfile - platforms: ${{ steps.prep.outputs.platform }} - push: ${{ github.event_name != 'pull_request' }} - tags: latest, ${{ steps.prep.outputs.VERSION }} - labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - - - name: manual build&push master - if: ${{ github.event.inputs.branch == 'master' }} - uses: docker/build-push-action@v2 - with: - file: ./${{ matrix.architecture }}.Dockerfile - platforms: ${{ steps.prep.outputs.platform }} - push: ${{ github.event_name != 'pull_request' }} - tags: latest, ${{ github.event.inputs.tag }} - labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - - - name: build&push develop - if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }} - uses: docker/build-push-action@v2 - with: - file: ./${{ matrix.architecture }}.Dockerfile - platforms: ${{ steps.prep.outputs.platform }} - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.metadata.outputs.tags }} - labels: ${{ steps.metadata.outputs.labels }} - build-args: TP_RELEASE=${{ steps.prep.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.created }} - - - name: build&push testing - if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }} + - name: build&push uses: docker/build-push-action@v2 with: push: ${{ github.event_name != 'pull_request' }} @@ -135,7 +91,7 @@ jobs: BUILD_ARCHITECTURE=${{ matrix.architecture }} publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: registry: [docker.io, ghcr.io] @@ -168,14 +124,15 @@ jobs: TAG=${GITHUB_REF//refs\/heads\//} SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER} VERSION=${{ steps.prep.outputs.VERSION }} - [[ -f linux-amd64.Dockerfile ]] && AMD64=${SOURCE}-linux-amd64 [[ -f linux-arm64.Dockerfile ]] && ARM64=${SOURCE}-linux-arm64 [[ -f linux-arm-v7.Dockerfile ]] && ARMV7=${SOURCE}-linux-arm-v7 docker manifest create ${IMAGE}:${TAG} ${AMD64} ${ARM64} ${ARMV7} docker manifest push ${IMAGE}:${TAG} + if [[! -z "${VERSION}" ]]; then docker manifest create ${IMAGE}:${TAG}-${VERSION//\~/-} ${AMD64} ${ARM64} ${ARMV7} docker manifest push ${IMAGE}:${TAG}-${VERSION//\~/-} + fi docker manifest create ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} ${AMD64} ${ARM64} ${ARMV7} docker manifest push ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} if [[ ${TAG} == master ]]; then diff --git a/linux-amd64.Dockerfile b/linux-amd64.Dockerfile index 5d81cd76..5d1e5de9 100644 --- a/linux-amd64.Dockerfile +++ b/linux-amd64.Dockerfile @@ -3,7 +3,7 @@ FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILD_ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION diff --git a/linux-arm-v7.Dockerfile b/linux-arm-v7.Dockerfile index 94b02f71..5f868fb9 100644 --- a/linux-arm-v7.Dockerfile +++ b/linux-arm-v7.Dockerfile @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILD_ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION diff --git a/linux-arm64.Dockerfile b/linux-arm64.Dockerfile index 0cdaa82b..2ebba47a 100644 --- a/linux-arm64.Dockerfile +++ b/linux-arm64.Dockerfile @@ -1,9 +1,9 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 +FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.14 # set version label ARG BUILD_DATE ARG TP_RELEASE -LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${ARCHITECTURE}" +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILD_ARCHITECTURE}" LABEL maintainer="gilbn" LABEL org.opencontainers.image.description DESCRIPTION From 9b94ef423017b55b3d4ec7915a47c84fcb55c54d Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 3 Apr 2022 15:31:09 +0200 Subject: [PATCH 14/14] workflow ignore --- .github/workflows/docker-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4b183387..65817d57 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -19,7 +19,8 @@ on: branches: - develop - testing - + paths-ignore: + - '.github/**' jobs: build-and-push-it-to-the-limit: runs-on: ubuntu-latest @@ -132,6 +133,8 @@ jobs: if [[! -z "${VERSION}" ]]; then docker manifest create ${IMAGE}:${TAG}-${VERSION//\~/-} ${AMD64} ${ARM64} ${ARMV7} docker manifest push ${IMAGE}:${TAG}-${VERSION//\~/-} + docker manifest create ${IMAGE}:${VERSION//\~/-} ${AMD64} ${ARM64} ${ARMV7} + docker manifest push ${IMAGE}:${VERSION//\~/-} fi docker manifest create ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} ${AMD64} ${ARM64} ${ARMV7} docker manifest push ${IMAGE}:${TAG}-${GITHUB_SHA:0:7}