From 1f78fe2d6f8c9fc8505791e397e1816c1e635402 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 10:52:04 +0200 Subject: [PATCH 1/9] Build ftl-build containers off of alpine:edge by default Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index e9e351c..bc3d162 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -28,23 +28,17 @@ jobs: matrix: include: - platform: linux/amd64 - container: alpine:3.18 - platform: linux/386 - container: alpine:3.18 - platform: linux/arm/v6 - container: alpine:3.18 - platform: linux/arm/v7 - container: alpine:3.18 - platform: linux/arm64/v8 - container: alpine:3.18 - platform: linux/riscv64 - container: alpine:edge steps: - - name: Prepare name for digest up/download + - + name: Prepare name for digest up/download run: | platform=${{ matrix.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - name: Checkout Repo uses: actions/checkout@v4 @@ -89,8 +83,6 @@ jobs: target: tester tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: | - CONTAINER=${{ matrix.container }} - name: Push builder target and push by digest if: github.event_name != 'pull_request' @@ -102,8 +94,6 @@ jobs: push: ${{ github.event_name != 'workflow_dispatch' }} target: builder labels: ${{ steps.meta.outputs.labels }} - build-args: | - CONTAINER=${{ matrix.container }} outputs: | type=image,name=${{ env.DOCKER_REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - From 487398e3c0d47a42527610d53845d91e102a714c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 10:52:22 +0200 Subject: [PATCH 2/9] Add clang into ftl-build containers Signed-off-by: DL6ER --- ftl-build/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 9dc7183..ec05c62 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -31,7 +31,8 @@ RUN apk add --no-cache \ libidn2-static \ libunistring-dev \ libunistring-static \ - perl + perl \ + clang # Install pdns from community repo RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VER}/community" >> /etc/apk/repositories; \ From e8c40677d711ebc89c36ff1d5486bcb3f1a05184 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 10:53:02 +0200 Subject: [PATCH 3/9] pdns is recent enough in alpine:edge so it doesn't need to community-detour Signed-off-by: DL6ER --- ftl-build/Dockerfile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index ec05c62..65748e7 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -32,16 +32,11 @@ RUN apk add --no-cache \ libunistring-dev \ libunistring-static \ perl \ - clang - -# Install pdns from community repo -RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VER}/community" >> /etc/apk/repositories; \ - apk update; \ - apk add --no-cache \ - pdns \ - pdns-backend-sqlite3 \ - pdns-recursor \ - pdns-doc + clang \ + pdns \ + pdns-backend-sqlite3 \ + pdns-recursor \ + pdns-doc ENV STATIC true ENV TEST true From 488482649657edb53eb7d05b07ebdbb4b3bde57d Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 11:09:11 +0200 Subject: [PATCH 4/9] Add GHCR target pushing Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 1 + ftl-build/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index bc3d162..c50ea76 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -96,6 +96,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} outputs: | type=image,name=${{ env.DOCKER_REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + type=image,name=${{ env.GITHUB_REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digests if: github.event_name != 'pull_request' diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 65748e7..6aae764 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -98,6 +98,7 @@ FROM builder AS tester # For FTL test compilation ARG TARGETPLATFORM +ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} ARG TARGETARCH ARG TARGETVARIANT ARG CI_ARCH="$TARGETPLATFORM" From 7247fbcef6fb7b9f34eb6b9e008390af09b47ca7 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 19:39:53 +0200 Subject: [PATCH 5/9] Also push on commits (just for testing) Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index c50ea76..513395d 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -5,6 +5,8 @@ on: - 'ftl-build/**' - '.github/workflows/ftl-build.yml' push: + branches: + - '**' tags: - "**" paths: From 48f3b370d8d26aa98bf291410f7b8b8b9214e065 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 20 May 2024 19:59:16 +0200 Subject: [PATCH 6/9] Export digests to correct directory Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index 513395d..9055a23 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -105,7 +105,7 @@ jobs: run: | mkdir -p /tmp/digests/ digest_docker="${{ steps.build_docker.outputs.digest }}" - touch "/tmp/digests/dockerhub/${digest_docker#sha256:}" + touch "/tmp/digests/${digest_docker#sha256:}" - name: Upload digest if: github.event_name != 'pull_request' @@ -135,7 +135,6 @@ jobs: path: /tmp/digests pattern: digests-* merge-multiple: true - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -147,7 +146,6 @@ jobs: docker_password: ${{ secrets.DOCKERHUB_PASS }} ghcr_username: ${{ github.repository_owner }} ghcr_password: ${{ secrets.GITHUB_TOKEN }} - - name: Docker meta id: meta_docker @@ -181,4 +179,3 @@ jobs: run: | docker buildx imagetools inspect ${{ env.DOCKER_REGISTRY_IMAGE }}:${{ steps.meta_docker.outputs.version }} docker buildx imagetools inspect ${{ env.GITHUB_REGISTRY_IMAGE }}:${{ steps.meta_docker.outputs.version }} - From c46927ebe130840d5e67c4b1cd1f6673290f6ea1 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 22 May 2024 06:13:25 +0200 Subject: [PATCH 7/9] Use alpine:latest for regular and alpine:edge scheduled ('nightly') builds Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index 9055a23..0775e7d 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -85,6 +85,8 @@ jobs: target: tester tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + CONTAINER=alpine:${{ github.event_name == 'scheduled' && 'edge' || 'latest' }} - name: Push builder target and push by digest if: github.event_name != 'pull_request' From 951232a81ba46fa0b787c44c04cd896561286aac Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 22 May 2024 06:18:01 +0200 Subject: [PATCH 8/9] RISCV64 is still not supported in latest, only in edge Signed-off-by: DL6ER --- .github/workflows/ftl-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ftl-build.yml b/.github/workflows/ftl-build.yml index 0775e7d..cd6d39f 100644 --- a/.github/workflows/ftl-build.yml +++ b/.github/workflows/ftl-build.yml @@ -86,7 +86,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - CONTAINER=alpine:${{ github.event_name == 'scheduled' && 'edge' || 'latest' }} + CONTAINER=alpine:${{ ( github.event_name == 'scheduled' || matrix.platform == 'linux/riscv64' ) && 'edge' || 'latest' }} - name: Push builder target and push by digest if: github.event_name != 'pull_request' From 801a0b1c6314f902f129a736e8d7580b5eb9319a Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 22 May 2024 20:39:12 +0200 Subject: [PATCH 9/9] Add gdb Signed-off-by: DL6ER --- ftl-build/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ftl-build/Dockerfile b/ftl-build/Dockerfile index 6aae764..ede83ad 100644 --- a/ftl-build/Dockerfile +++ b/ftl-build/Dockerfile @@ -36,7 +36,8 @@ RUN apk add --no-cache \ pdns \ pdns-backend-sqlite3 \ pdns-recursor \ - pdns-doc + pdns-doc \ + gdb ENV STATIC true ENV TEST true