diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..cd59642 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,52 @@ +# For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. +name-template: '$RESOLVED_VERSION 🌈' +tag-template: '$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🖊️ Refactors' + labels: + - 'refactor' + - title: '👗 Style' + labels: + - 'style' + - title: '📝 Documentation' + labels: + - 'docs' + - 'documentation' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +version-resolver: + major: + labels: + # - 'major' + - 'breaking' + minor: + labels: + # - 'minor' + - 'feature' + - 'enhancement' + - 'refactor' + patch: + labels: + # - 'patch' + - 'fix' + - 'bugfix' + - 'bug' + - 'style' + - 'docs' + - 'documentation' + default: patch +sort-by: title +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml new file mode 100644 index 0000000..f07f5e7 --- /dev/null +++ b/.github/workflows/ci-master-pr.yml @@ -0,0 +1,2701 @@ +name: ci-master-pr + +on: + push: + branches: + - master + - release # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + pull_request: + branches: + - master +jobs: + + build-v0-14-9-alpine-3-14: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.14.9-alpine-3.14 + # VARIANT_TAG_WITH_REF: v0.14.9-alpine-3.14-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.14.9-alpine-3.14 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm/v7,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-14-9-sops-ssh-alpine-3-14: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.14.9-sops-ssh-alpine-3.14 + # VARIANT_TAG_WITH_REF: v0.14.9-sops-ssh-alpine-3.14-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.14.9-sops-ssh-alpine-3.14 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm/v7,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + ${{ github.repository }}:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-14-4-alpine-3-13: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.14.4-alpine-3.13 + # VARIANT_TAG_WITH_REF: v0.14.4-alpine-3.13-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.14.4-alpine-3.13 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-14-4-sops-ssh-alpine-3-13: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.14.4-sops-ssh-alpine-3.13 + # VARIANT_TAG_WITH_REF: v0.14.4-sops-ssh-alpine-3.13-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.14.4-sops-ssh-alpine-3.13 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-25-alpine-3-12: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.25-alpine-3.12 + # VARIANT_TAG_WITH_REF: v0.12.25-alpine-3.12-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.25-alpine-3.12 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-25-sops-ssh-alpine-3-12: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.25-sops-ssh-alpine-3.12 + # VARIANT_TAG_WITH_REF: v0.12.25-sops-ssh-alpine-3.12-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.25-sops-ssh-alpine-3.12 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-17-alpine-3-11: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.17-alpine-3.11 + # VARIANT_TAG_WITH_REF: v0.12.17-alpine-3.11-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.17-alpine-3.11 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-17-sops-ssh-alpine-3-11: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.17-sops-ssh-alpine-3.11 + # VARIANT_TAG_WITH_REF: v0.12.17-sops-ssh-alpine-3.11-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.17-sops-ssh-alpine-3.11 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-6-alpine-3-10: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.6-alpine-3.10 + # VARIANT_TAG_WITH_REF: v0.12.6-alpine-3.10-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.6-alpine-3.10 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-12-6-sops-ssh-alpine-3-10: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.12.6-sops-ssh-alpine-3.10 + # VARIANT_TAG_WITH_REF: v0.12.6-sops-ssh-alpine-3.10-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.12.6-sops-ssh-alpine-3.10 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-8-alpine-3-9: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.8-alpine-3.9 + # VARIANT_TAG_WITH_REF: v0.11.8-alpine-3.9-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.8-alpine-3.9 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-8-sops-ssh-alpine-3-9: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.8-sops-ssh-alpine-3.9 + # VARIANT_TAG_WITH_REF: v0.11.8-sops-ssh-alpine-3.9-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.8-sops-ssh-alpine-3.9 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-7-alpine-3-8: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.7-alpine-3.8 + # VARIANT_TAG_WITH_REF: v0.11.7-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.7-alpine-3.8 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-7-sops-ssh-alpine-3-8: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.7-sops-ssh-alpine-3.8 + # VARIANT_TAG_WITH_REF: v0.11.7-sops-ssh-alpine-3.8-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.7-sops-ssh-alpine-3.8 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-0-alpine-3-7: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.0-alpine-3.7 + # VARIANT_TAG_WITH_REF: v0.11.0-alpine-3.7-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.0-alpine-3.7 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-11-0-sops-ssh-alpine-3-7: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.11.0-sops-ssh-alpine-3.7 + # VARIANT_TAG_WITH_REF: v0.11.0-sops-ssh-alpine-3.7-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.11.0-sops-ssh-alpine-3.7 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-9-5-alpine-3-6: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.9.5-alpine-3.6 + # VARIANT_TAG_WITH_REF: v0.9.5-alpine-3.6-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.9.5-alpine-3.6 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-9-5-sops-ssh-alpine-3-6: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.9.5-sops-ssh-alpine-3.6 + # VARIANT_TAG_WITH_REF: v0.9.5-sops-ssh-alpine-3.6-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.9.5-sops-ssh-alpine-3.6 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-8-1-alpine-3-5: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.8.1-alpine-3.5 + # VARIANT_TAG_WITH_REF: v0.8.1-alpine-3.5-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.8.1-alpine-3.5 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-v0-8-1-sops-ssh-alpine-3-5: + runs-on: ubuntu-latest + env: + VARIANT_TAG: v0.8.1-sops-ssh-alpine-3.5 + # VARIANT_TAG_WITH_REF: v0.8.1-sops-ssh-alpine-3.5-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/v0.8.1-sops-ssh-alpine-3.5 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Display system info (linux) + run: | + set -e + hostname + whoami + cat /etc/*release + lscpu + free + df -h + pwd + docker info + docker version + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + run: | + set -e + + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) + + # Get 'ref-name' from 'refs/heads/ref-name' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" + VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" + + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/amd64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + converge-master-and-release-branches: + needs: [build-v0-14-9-alpine-3-14, build-v0-14-9-sops-ssh-alpine-3-14, build-v0-14-4-alpine-3-13, build-v0-14-4-sops-ssh-alpine-3-13, build-v0-12-25-alpine-3-12, build-v0-12-25-sops-ssh-alpine-3-12, build-v0-12-17-alpine-3-11, build-v0-12-17-sops-ssh-alpine-3-11, build-v0-12-6-alpine-3-10, build-v0-12-6-sops-ssh-alpine-3-10, build-v0-11-8-alpine-3-9, build-v0-11-8-sops-ssh-alpine-3-9, build-v0-11-7-alpine-3-8, build-v0-11-7-sops-ssh-alpine-3-8, build-v0-11-0-alpine-3-7, build-v0-11-0-sops-ssh-alpine-3-7, build-v0-9-5-alpine-3-6, build-v0-9-5-sops-ssh-alpine-3-6, build-v0-8-1-alpine-3-5, build-v0-8-1-sops-ssh-alpine-3-5] + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Merge release into master (fast-forward) + run: | + git checkout master + git merge release + git push origin master + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + resolve-release-tag: + runs-on: ubuntu-latest + outputs: + TAG: ${{ steps.resolve-release-tag.outputs.TAG }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Resolve release tag + id: resolve-release-tag + run: | + set +e + # E.g. 20210402 + TODAYS_DATE=$( date -u '+%Y%m%d' ) + # Is this the first tag for this date? + TODAYS_DATE_TAGS=$( git tag --list | grep "^$TODAYS_DATE" ) + TAG= + if [ -z "$TODAYS_DATE_TAGS" ]; then + # E.g. 20210402.0.0 + TAG="$TODAYS_DATE.0.0" # Send this to stdout + else + # E.g. if there are 20210402.0.0, 20210402.0.1, 20210402.0.2, this returns 2 + VERSION_MINOR_LATEST=$( echo "$TODAYS_DATE_TAGS" | cut -d '.' -f 3 | sort -nr | head -n1 ) + # Minor version + VERSION_MINOR=$( expr "$VERSION_MINOR_LATEST" + 1 ) + # E.g. 20210402.0.3 + TAG="$TODAYS_DATE.0.$VERSION_MINOR" # Send this to stdout + fi + echo "TODAYS_DATE: $TODAYS_DATE" + echo "TODAYS_DATE_TAGS: $TODAYS_DATE_TAGS" + echo "TAG: $TAG" + echo "::set-output name=TAG::$TAG" + - name: Print outputs + run: echo ${{ steps.resolve-release-tag.outputs.TAG }} + + update-draft-release: + needs: [build-v0-14-9-alpine-3-14, build-v0-14-9-sops-ssh-alpine-3-14, build-v0-14-4-alpine-3-13, build-v0-14-4-sops-ssh-alpine-3-13, build-v0-12-25-alpine-3-12, build-v0-12-25-sops-ssh-alpine-3-12, build-v0-12-17-alpine-3-11, build-v0-12-17-sops-ssh-alpine-3-11, build-v0-12-6-alpine-3-10, build-v0-12-6-sops-ssh-alpine-3-10, build-v0-11-8-alpine-3-9, build-v0-11-8-sops-ssh-alpine-3-9, build-v0-11-7-alpine-3-8, build-v0-11-7-sops-ssh-alpine-3-8, build-v0-11-0-alpine-3-7, build-v0-11-0-sops-ssh-alpine-3-7, build-v0-9-5-alpine-3-6, build-v0-9-5-sops-ssh-alpine-3-6, build-v0-8-1-alpine-3-5, build-v0-8-1-sops-ssh-alpine-3-5, resolve-release-tag] + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Print inputs + run: echo ${{ needs.resolve-release-tag.outputs.TAG }} + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: false + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-draft-release: + needs: [build-v0-14-9-alpine-3-14, build-v0-14-9-sops-ssh-alpine-3-14, build-v0-14-4-alpine-3-13, build-v0-14-4-sops-ssh-alpine-3-13, build-v0-12-25-alpine-3-12, build-v0-12-25-sops-ssh-alpine-3-12, build-v0-12-17-alpine-3-11, build-v0-12-17-sops-ssh-alpine-3-11, build-v0-12-6-alpine-3-10, build-v0-12-6-sops-ssh-alpine-3-10, build-v0-11-8-alpine-3-9, build-v0-11-8-sops-ssh-alpine-3-9, build-v0-11-7-alpine-3-8, build-v0-11-7-sops-ssh-alpine-3-8, build-v0-11-0-alpine-3-7, build-v0-11-0-sops-ssh-alpine-3-7, build-v0-9-5-alpine-3-6, build-v0-9-5-sops-ssh-alpine-3-6, build-v0-8-1-alpine-3-5, build-v0-8-1-sops-ssh-alpine-3-5, converge-master-and-release-branches, resolve-release-tag] + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: true + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..3021d52 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# docker-terraform + +[![github-actions](https://github.com/theohbrothers/docker-terraform/workflows/ci-master-pr/badge.svg)](https://github.com/theohbrothers/docker-terraform/actions) +[![github-release](https://img.shields.io/github/v/release/theohbrothers/docker-terraform?style=flat-square)](https://github.com/theohbrothers/docker-terraform/releases/) +[![docker-image-size](https://img.shields.io/docker/image-size/theohbrothers/docker-terraform/latest)](https://hub.docker.com/r/theohbrothers/docker-terraform) + +Dockerized `terraform` with useful tools. + +The base image is `alpine`, and not the closed-source [`hashicorp/terraform` image on DockerHub](https://hub.docker.com/r/hashicorp/terraform), see [here](https://github.com/hashicorp/terraform/blob/v1.0.0/Dockerfile). + +## Tags + +| Tag | Dockerfile Build Context | +|:-------:|:---------:| +| `:v0.14.9-alpine-3.14` | [View](variants/v0.14.9-alpine-3.14 ) | +| `:v0.14.9-sops-ssh-alpine-3.14`, `:latest` | [View](variants/v0.14.9-sops-ssh-alpine-3.14 ) | +| `:v0.14.4-alpine-3.13` | [View](variants/v0.14.4-alpine-3.13 ) | +| `:v0.14.4-sops-ssh-alpine-3.13` | [View](variants/v0.14.4-sops-ssh-alpine-3.13 ) | +| `:v0.12.25-alpine-3.12` | [View](variants/v0.12.25-alpine-3.12 ) | +| `:v0.12.25-sops-ssh-alpine-3.12` | [View](variants/v0.12.25-sops-ssh-alpine-3.12 ) | +| `:v0.12.17-alpine-3.11` | [View](variants/v0.12.17-alpine-3.11 ) | +| `:v0.12.17-sops-ssh-alpine-3.11` | [View](variants/v0.12.17-sops-ssh-alpine-3.11 ) | +| `:v0.12.6-alpine-3.10` | [View](variants/v0.12.6-alpine-3.10 ) | +| `:v0.12.6-sops-ssh-alpine-3.10` | [View](variants/v0.12.6-sops-ssh-alpine-3.10 ) | +| `:v0.11.8-alpine-3.9` | [View](variants/v0.11.8-alpine-3.9 ) | +| `:v0.11.8-sops-ssh-alpine-3.9` | [View](variants/v0.11.8-sops-ssh-alpine-3.9 ) | +| `:v0.11.7-alpine-3.8` | [View](variants/v0.11.7-alpine-3.8 ) | +| `:v0.11.7-sops-ssh-alpine-3.8` | [View](variants/v0.11.7-sops-ssh-alpine-3.8 ) | +| `:v0.11.0-alpine-3.7` | [View](variants/v0.11.0-alpine-3.7 ) | +| `:v0.11.0-sops-ssh-alpine-3.7` | [View](variants/v0.11.0-sops-ssh-alpine-3.7 ) | +| `:v0.9.5-alpine-3.6` | [View](variants/v0.9.5-alpine-3.6 ) | +| `:v0.9.5-sops-ssh-alpine-3.6` | [View](variants/v0.9.5-sops-ssh-alpine-3.6 ) | +| `:v0.8.1-alpine-3.5` | [View](variants/v0.8.1-alpine-3.5 ) | +| `:v0.8.1-sops-ssh-alpine-3.5` | [View](variants/v0.8.1-sops-ssh-alpine-3.5 ) | diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 52f06d8..8a0d83a 100755 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -17,7 +17,7 @@ $local:VARIANTS_MATRIX = @( distro_version = '3.13' subvariants = @( @{ components = $null } - @{ components = @( 'sops', 'ssh' ); tag_as_latest = $true } + @{ components = @( 'sops', 'ssh' ) } ) } @{ diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index 1ac0a22..f146dc6 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -107,7 +107,18 @@ $VARIANTS | % { uses: docker/build-push-action@v2 with: context: `${{ steps.prep.outputs.CONTEXT }} - platforms: $( if ($_['_metadata']['distro'] -eq 'alpine' -and $_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { 'linux/amd64' } else { 'linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x' } ) + platforms: $( + if ($_['_metadata']['distro'] -eq 'alpine') { + if ($_['_metadata']['distro_version'] -in @( '3.14' ) ) { + 'linux/386,linux/amd64,linux/arm,linux/arm/v7,linux/arm64,linux/s390x' + }elseif ($_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { + # 'linux/386,linux/amd64,linux/arm64' + 'linux/amd64' + }else { + 'linux/386,linux/amd64,linux/arm64,linux/s390x' + } + } + ) push: false tags: | `${{ github.repository }}:`${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} @@ -122,7 +133,18 @@ $VARIANTS | % { uses: docker/build-push-action@v2 with: context: `${{ steps.prep.outputs.CONTEXT }} - platforms: $( if ($_['_metadata']['distro'] -eq 'alpine' -and $_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { 'linux/amd64' } else { 'linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x' } ) + platforms: $( + if ($_['_metadata']['distro'] -eq 'alpine') { + if ($_['_metadata']['distro_version'] -in @( '3.14' ) ) { + 'linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x' + }elseif ($_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { + # 'linux/386,linux/amd64,linux/arm64' + 'linux/amd64' + }else { + 'linux/386,linux/amd64,linux/arm64,linux/s390x' + } + } + ) push: true tags: | `${{ github.repository }}:`${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} @@ -137,7 +159,18 @@ $VARIANTS | % { uses: docker/build-push-action@v2 with: context: `${{ steps.prep.outputs.CONTEXT }} - platforms: $( if ($_['_metadata']['distro'] -eq 'alpine' -and $_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { 'linux/amd64' } else { 'linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x' } ) + platforms: $( + if ($_['_metadata']['distro'] -eq 'alpine') { + if ($_['_metadata']['distro_version'] -in @( '3.14' ) ) { + 'linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x' + }elseif ($_['_metadata']['distro_version'] -in @( '3.3', '3.4', '3.5' ) ) { + # 'linux/386,linux/amd64,linux/arm64' + 'linux/amd64' + }else { + 'linux/386,linux/amd64,linux/arm64,linux/s390x' + } + } + ) push: true tags: | `${{ github.repository }}:`${{ steps.prep.outputs.VARIANT_TAG }} diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index 23c04bd..cb83327 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -10,17 +10,29 @@ RUN apk add --no-cache $( $VARIANT['_metadata']['package'] )=$( $VARIANT['_metad "@ if ( $VARIANT['_metadata']['components'] -contains 'sops' ) { - if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and $VARIANT['_metadata']['distro_version'] -eq '3.6' ) { + if ( $VARIANT['_metadata']['distro'] -eq 'alpine' -and ([version]$VARIANT['_metadata']['distro_version']).Major -eq 3 -and ([version]$VARIANT['_metadata']['distro_version']).Minor -le 6 ) { @" -# Fix wget not working in alpine:3.6. https://github.com/gliderlabs/docker-alpine/issues/423 -RUN apk add --no-cache libressl +# Fix generic certification validation errors in alpine 3.5: https://github.com/docker-library/official-images/issues/2773#issuecomment-350431934 +RUN apk add --no-cache ca-certificates + +# Fix wget not working in alpine:3.6 and below. https://github.com/gliderlabs/docker-alpine/issues/423 +# RUN apk add --no-cache libressl + +# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773 +RUN apk add --no-cache curl \ + && curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \ + && apk del curl "@ - } - @" + }else { + @" RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +"@ + } +@" RUN apk add --no-cache gnupg @@ -36,6 +48,6 @@ RUN apk add --no-cache openssh-client } @" -CMD [ "ansible" ] +CMD [ "terraform" ] "@ diff --git a/generate/templates/README.md.ps1 b/generate/templates/README.md.ps1 index 805baf3..2fa347f 100755 --- a/generate/templates/README.md.ps1 +++ b/generate/templates/README.md.ps1 @@ -7,6 +7,8 @@ Dockerized ``terraform`` with useful tools. +The base image is ``alpine``, and not the closed-source [``hashicorp/terraform`` image on DockerHub](https://hub.docker.com/r/hashicorp/terraform), see [here](https://github.com/hashicorp/terraform/blob/v1.0.0/Dockerfile). + ## Tags | Tag | Dockerfile Build Context | diff --git a/variants/v0.11.0-alpine-3.7/Dockerfile b/variants/v0.11.0-alpine-3.7/Dockerfile new file mode 100644 index 0000000..03a8546 --- /dev/null +++ b/variants/v0.11.0-alpine-3.7/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.7 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.0-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.11.0-sops-ssh-alpine-3.7/Dockerfile b/variants/v0.11.0-sops-ssh-alpine-3.7/Dockerfile new file mode 100644 index 0000000..9ea014f --- /dev/null +++ b/variants/v0.11.0-sops-ssh-alpine-3.7/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.7 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.0-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.11.7-alpine-3.8/Dockerfile b/variants/v0.11.7-alpine-3.8/Dockerfile new file mode 100644 index 0000000..1dadce9 --- /dev/null +++ b/variants/v0.11.7-alpine-3.8/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.7-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.11.7-sops-ssh-alpine-3.8/Dockerfile b/variants/v0.11.7-sops-ssh-alpine-3.8/Dockerfile new file mode 100644 index 0000000..5931858 --- /dev/null +++ b/variants/v0.11.7-sops-ssh-alpine-3.8/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.8 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.7-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.11.8-alpine-3.9/Dockerfile b/variants/v0.11.8-alpine-3.9/Dockerfile new file mode 100644 index 0000000..86bac0d --- /dev/null +++ b/variants/v0.11.8-alpine-3.9/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.9 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.8-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.11.8-sops-ssh-alpine-3.9/Dockerfile b/variants/v0.11.8-sops-ssh-alpine-3.9/Dockerfile new file mode 100644 index 0000000..b4cfac5 --- /dev/null +++ b/variants/v0.11.8-sops-ssh-alpine-3.9/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.9 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.11.8-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.12.17-alpine-3.11/Dockerfile b/variants/v0.12.17-alpine-3.11/Dockerfile new file mode 100644 index 0000000..fdfdbea --- /dev/null +++ b/variants/v0.12.17-alpine-3.11/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.11 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.17-r1 + +CMD [ "terraform" ] diff --git a/variants/v0.12.17-sops-ssh-alpine-3.11/Dockerfile b/variants/v0.12.17-sops-ssh-alpine-3.11/Dockerfile new file mode 100644 index 0000000..687a532 --- /dev/null +++ b/variants/v0.12.17-sops-ssh-alpine-3.11/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.11 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.17-r1 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.12.25-alpine-3.12/Dockerfile b/variants/v0.12.25-alpine-3.12/Dockerfile new file mode 100644 index 0000000..65c103e --- /dev/null +++ b/variants/v0.12.25-alpine-3.12/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.12 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.25-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.12.25-sops-ssh-alpine-3.12/Dockerfile b/variants/v0.12.25-sops-ssh-alpine-3.12/Dockerfile new file mode 100644 index 0000000..75ab73c --- /dev/null +++ b/variants/v0.12.25-sops-ssh-alpine-3.12/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.12 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.25-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.12.6-alpine-3.10/Dockerfile b/variants/v0.12.6-alpine-3.10/Dockerfile new file mode 100644 index 0000000..be84478 --- /dev/null +++ b/variants/v0.12.6-alpine-3.10/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.10 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.6-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.12.6-sops-ssh-alpine-3.10/Dockerfile b/variants/v0.12.6-sops-ssh-alpine-3.10/Dockerfile new file mode 100644 index 0000000..6be162f --- /dev/null +++ b/variants/v0.12.6-sops-ssh-alpine-3.10/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.10 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.12.6-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.14.4-alpine-3.13/Dockerfile b/variants/v0.14.4-alpine-3.13/Dockerfile new file mode 100644 index 0000000..2ed8a32 --- /dev/null +++ b/variants/v0.14.4-alpine-3.13/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.13 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.14.4-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.14.4-sops-ssh-alpine-3.13/Dockerfile b/variants/v0.14.4-sops-ssh-alpine-3.13/Dockerfile new file mode 100644 index 0000000..8116ac2 --- /dev/null +++ b/variants/v0.14.4-sops-ssh-alpine-3.13/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.13 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.14.4-r0 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.14.9-alpine-3.14/Dockerfile b/variants/v0.14.9-alpine-3.14/Dockerfile new file mode 100644 index 0000000..16cdf0d --- /dev/null +++ b/variants/v0.14.9-alpine-3.14/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.14 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.14.9-r2 + +CMD [ "terraform" ] diff --git a/variants/v0.14.9-sops-ssh-alpine-3.14/Dockerfile b/variants/v0.14.9-sops-ssh-alpine-3.14/Dockerfile new file mode 100644 index 0000000..9d72e88 --- /dev/null +++ b/variants/v0.14.9-sops-ssh-alpine-3.14/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.14 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.14.9-r2 + +RUN wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.8.1-alpine-3.5/Dockerfile b/variants/v0.8.1-alpine-3.5/Dockerfile new file mode 100644 index 0000000..153e6ae --- /dev/null +++ b/variants/v0.8.1-alpine-3.5/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.5 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.8.1-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.8.1-sops-ssh-alpine-3.5/Dockerfile b/variants/v0.8.1-sops-ssh-alpine-3.5/Dockerfile new file mode 100644 index 0000000..743ba27 --- /dev/null +++ b/variants/v0.8.1-sops-ssh-alpine-3.5/Dockerfile @@ -0,0 +1,23 @@ +FROM alpine:3.5 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.8.1-r0 + +# Fix generic certification validation errors in alpine 3.5: https://github.com/docker-library/official-images/issues/2773#issuecomment-350431934 +RUN apk add --no-cache ca-certificates + +# Fix wget not working in alpine:3.6 and below. https://github.com/gliderlabs/docker-alpine/issues/423 +# RUN apk add --no-cache libressl + +# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773 +RUN apk add --no-cache curl \ + && curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \ + && apk del curl + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ] diff --git a/variants/v0.9.5-alpine-3.6/Dockerfile b/variants/v0.9.5-alpine-3.6/Dockerfile new file mode 100644 index 0000000..29e9a3f --- /dev/null +++ b/variants/v0.9.5-alpine-3.6/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3.6 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.9.5-r0 + +CMD [ "terraform" ] diff --git a/variants/v0.9.5-sops-ssh-alpine-3.6/Dockerfile b/variants/v0.9.5-sops-ssh-alpine-3.6/Dockerfile new file mode 100644 index 0000000..3cae84b --- /dev/null +++ b/variants/v0.9.5-sops-ssh-alpine-3.6/Dockerfile @@ -0,0 +1,23 @@ +FROM alpine:3.6 +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN apk add --no-cache terraform=0.9.5-r0 + +# Fix generic certification validation errors in alpine 3.5: https://github.com/docker-library/official-images/issues/2773#issuecomment-350431934 +RUN apk add --no-cache ca-certificates + +# Fix wget not working in alpine:3.6 and below. https://github.com/gliderlabs/docker-alpine/issues/423 +# RUN apk add --no-cache libressl + +# Fix wget error 'wget: SSL/TLS certificate is not being validated!' in alpine:3.5, use curl instead: https://github.com/docker-library/official-images/issues/2773 +RUN apk add --no-cache curl \ + && curl -sL https://github.com/mozilla/sops/releases/download/v3.7.1/sops-v3.7.1.linux > /usr/local/bin/sops && chmod +x /usr/local/bin/sops \ + && apk del curl + +RUN apk add --no-cache gnupg + +RUN apk add --no-cache openssh-client + +CMD [ "terraform" ]