From 3bd6a09b4a437731a4b7ece47f8156ad34c09fca Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sat, 2 Nov 2024 08:46:44 +0000 Subject: [PATCH] Enhancement: Bump edge variants to 10.5.0 --- .github/workflows/ci-master-pr.yml | 72 +++++++++---------- README.md | 4 +- generate/definitions/VARIANTS.ps1 | 2 +- variants/10.5.0-alpine-edge/Dockerfile | 16 +++++ .../10.5.0-alpine-edge/docker-entrypoint.sh | 8 +++ .../10.5.0-sops-ssh-alpine-edge/Dockerfile | 26 +++++++ .../docker-entrypoint.sh | 8 +++ 7 files changed, 97 insertions(+), 39 deletions(-) create mode 100644 variants/10.5.0-alpine-edge/Dockerfile create mode 100644 variants/10.5.0-alpine-edge/docker-entrypoint.sh create mode 100644 variants/10.5.0-sops-ssh-alpine-edge/Dockerfile create mode 100644 variants/10.5.0-sops-ssh-alpine-edge/docker-entrypoint.sh diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 6ce1c0c..1c5690d 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -33,7 +33,7 @@ jobs: run: | git diff --exit-code - build-10-2-0: + build-10-5-0: runs-on: ubuntu-latest steps: - name: Checkout @@ -64,9 +64,9 @@ jobs: uses: actions/cache@v4 with: path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-10.2.0-${{ github.sha }} + key: ${{ runner.os }}-buildx-10.5.0-${{ github.sha }} restore-keys: | - ${{ runner.os }}-buildx-10.2.0- + ${{ runner.os }}-buildx-10.5.0- ${{ runner.os }}-buildx- - name: Login to Docker Hub registry @@ -79,7 +79,7 @@ jobs: # This step generates the docker tags - name: Prepare - id: prep-10-2-0-alpine-edge + id: prep-10-5-0-alpine-edge run: | set -e @@ -92,7 +92,7 @@ jobs: # Generate docker image tags # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' # E.g. 'master-' and 'master-abc0123-' - VARIANT="10.2.0-alpine-edge" + VARIANT="10.5.0-alpine-edge" REF_VARIANT="${REF}-${VARIANT}" REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" @@ -102,52 +102,52 @@ jobs: echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - name: 10.2.0-alpine-edge - Build (PRs) + - name: 10.5.0-alpine-edge - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' uses: docker/build-push-action@v5 with: - context: variants/10.2.0-alpine-edge + context: variants/10.5.0-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: false tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 10.2.0-alpine-edge - Build and push (master) + - name: 10.5.0-alpine-edge - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5 with: - context: variants/10.2.0-alpine-edge + context: variants/10.5.0-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 10.2.0-alpine-edge - Build and push (release) + - name: 10.5.0-alpine-edge - Build and push (release) if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: - context: variants/10.2.0-alpine-edge + context: variants/10.5.0-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-alpine-edge.outputs.REF_SHA_VARIANT }} ${{ github.repository }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max # This step generates the docker tags - name: Prepare - id: prep-10-2-0-sops-ssh-alpine-edge + id: prep-10-5-0-sops-ssh-alpine-edge run: | set -e @@ -160,7 +160,7 @@ jobs: # Generate docker image tags # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' # E.g. 'master-' and 'master-abc0123-' - VARIANT="10.2.0-sops-ssh-alpine-edge" + VARIANT="10.5.0-sops-ssh-alpine-edge" REF_VARIANT="${REF}-${VARIANT}" REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" @@ -170,45 +170,45 @@ jobs: echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT - - name: 10.2.0-sops-ssh-alpine-edge - Build (PRs) + - name: 10.5.0-sops-ssh-alpine-edge - Build (PRs) # Run only on pull requests if: github.event_name == 'pull_request' uses: docker/build-push-action@v5 with: - context: variants/10.2.0-sops-ssh-alpine-edge + context: variants/10.5.0-sops-ssh-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: false tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 10.2.0-sops-ssh-alpine-edge - Build and push (master) + - name: 10.5.0-sops-ssh-alpine-edge - Build and push (master) # Run only on master if: github.ref == 'refs/heads/master' uses: docker/build-push-action@v5 with: - context: variants/10.2.0-sops-ssh-alpine-edge + context: variants/10.5.0-sops-ssh-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max - - name: 10.2.0-sops-ssh-alpine-edge - Build and push (release) + - name: 10.5.0-sops-ssh-alpine-edge - Build and push (release) if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: - context: variants/10.2.0-sops-ssh-alpine-edge + context: variants/10.5.0-sops-ssh-alpine-edge platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x push: true tags: | - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} - ${{ github.repository }}:${{ steps.prep-10-2-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-10-5-0-sops-ssh-alpine-edge.outputs.REF_SHA_VARIANT }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max @@ -2640,7 +2640,7 @@ jobs: update-draft-release: needs: - - build-10-2-0 + - build-10-5-0 - build-9-5-1 - build-8-6-1 - build-7-5-0 @@ -2667,7 +2667,7 @@ jobs: publish-draft-release: needs: - - build-10-2-0 + - build-10-5-0 - build-9-5-1 - build-8-6-1 - build-7-5-0 @@ -2696,7 +2696,7 @@ jobs: update-dockerhub-description: needs: - - build-10-2-0 + - build-10-5-0 - build-9-5-1 - build-8-6-1 - build-7-5-0 diff --git a/README.md b/README.md index f10a463..2d7f80e 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Dockerized `ansible` with useful tools. | Tag | Dockerfile Build Context | |:-------:|:---------:| -| `:10.2.0-alpine-edge`, `:latest` | [View](variants/10.2.0-alpine-edge) | -| `:10.2.0-sops-ssh-alpine-edge` | [View](variants/10.2.0-sops-ssh-alpine-edge) | +| `:10.5.0-alpine-edge`, `:latest` | [View](variants/10.5.0-alpine-edge) | +| `:10.5.0-sops-ssh-alpine-edge` | [View](variants/10.5.0-sops-ssh-alpine-edge) | | `:9.5.1-alpine-3.20` | [View](variants/9.5.1-alpine-3.20) | | `:9.5.1-sops-ssh-alpine-3.20` | [View](variants/9.5.1-sops-ssh-alpine-3.20) | | `:8.6.1-alpine-3.19` | [View](variants/8.6.1-alpine-3.19) | diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 47fdfc5..9a5f3f4 100755 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -5,7 +5,7 @@ $local:VARIANTS_MATRIX = @( @{ package = 'ansible' - package_version = '10.2.0' + package_version = '10.5.0' distro = 'alpine' distro_version = 'edge' subvariants = @( diff --git a/variants/10.5.0-alpine-edge/Dockerfile b/variants/10.5.0-alpine-edge/Dockerfile new file mode 100644 index 0000000..47e856f --- /dev/null +++ b/variants/10.5.0-alpine-edge/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:edge +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +# Install ansible +RUN set -eux; \ + apk add --no-cache ansible~=10.5.0; \ + ansible --version + +RUN apk add --no-cache ca-certificates + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/variants/10.5.0-alpine-edge/docker-entrypoint.sh b/variants/10.5.0-alpine-edge/docker-entrypoint.sh new file mode 100644 index 0000000..8229e62 --- /dev/null +++ b/variants/10.5.0-alpine-edge/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- ansible "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/variants/10.5.0-sops-ssh-alpine-edge/Dockerfile b/variants/10.5.0-sops-ssh-alpine-edge/Dockerfile new file mode 100644 index 0000000..a977d24 --- /dev/null +++ b/variants/10.5.0-sops-ssh-alpine-edge/Dockerfile @@ -0,0 +1,26 @@ +FROM alpine:edge +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +# Install ansible +RUN set -eux; \ + apk add --no-cache ansible~=10.5.0; \ + ansible --version + +RUN apk add --no-cache ca-certificates + +RUN set -eux; \ + wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux > /usr/local/bin/sops; \ + chmod +x /usr/local/bin/sops; \ + sha256sum /usr/local/bin/sops | grep '^53aec65e45f62a769ff24b7e5384f0c82d62668dd96ed56685f649da114b4dbb '; \ + sops --version + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +ENTRYPOINT [ "/docker-entrypoint.sh" ] diff --git a/variants/10.5.0-sops-ssh-alpine-edge/docker-entrypoint.sh b/variants/10.5.0-sops-ssh-alpine-edge/docker-entrypoint.sh new file mode 100644 index 0000000..8229e62 --- /dev/null +++ b/variants/10.5.0-sops-ssh-alpine-edge/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- ansible "$@" +fi + +exec "$@" \ No newline at end of file