From 475d4c697a5549073129d8e9dac9caedcd5da7f5 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 26 Jan 2023 13:49:41 -0800 Subject: [PATCH 1/3] Add job to build docker images without CGO --- .github/workflows/release.yml | 14 ++++++++++++++ docker/Dockerfile.cloud | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 docker/Dockerfile.cloud diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a61f9f..4d64544 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,3 +79,17 @@ jobs: docker_image: smallstep/step-kms-plugin docker_file: docker/Dockerfile secrets: inherit + + build_upload_docker_cloud: + name: Build & Upload Cloud Only Docker Images + needs: create_release + permissions: + id-token: write + contents: write + uses: smallstep/workflows/.github/workflows/docker-buildx-push.yml@main + with: + platforms: linux/amd64,linux/arm64 + tags: ${{ needs.create_release.outputs.docker_tags }} + docker_image: smallstep/step-kms-plugin-cloud + docker_file: docker/Dockerfile.cloud + secrets: inherit diff --git a/docker/Dockerfile.cloud b/docker/Dockerfile.cloud new file mode 100644 index 0000000..f9eee9f --- /dev/null +++ b/docker/Dockerfile.cloud @@ -0,0 +1,15 @@ +FROM golang:alpine AS builder + +WORKDIR /src +COPY . . + +RUN apk add --no-cache git make +RUN make V=1 CGO_ENABLED=0 build + +FROM smallstep/step-cli:latest + +COPY --from=builder /src/bin/step-kms-plugin /usr/local/bin/step-kms-plugin + +USER step + +CMD ["/bin/bash"] \ No newline at end of file From 9f43ed0e60e6a239bac808198e0fc0377c4c0c96 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 26 Jan 2023 14:11:32 -0800 Subject: [PATCH 2/3] Add cloud tags --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d64544..15cba68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,7 @@ jobs: runs-on: ubuntu-latest env: DOCKER_IMAGE: smallstep/step-kms-plugin + DOCKER_IMAGE_CLOUD: smallstep/step-kms-plugin-cloud outputs: version: ${{ steps.extract-tag.outputs.VERSION }} is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} @@ -36,10 +37,12 @@ jobs: VERSION=${GITHUB_REF#refs/tags/v} echo "VERSION=${VERSION}" >> ${GITHUB_OUTPUT} echo "DOCKER_TAGS=${{ env.DOCKER_IMAGE }}:${VERSION}" >> ${GITHUB_ENV} + echo "DOCKER_TAGS_CLOUD=${{ env.DOCKER_IMAGE_CLOUD }}:${VERSION}" >> ${GITHUB_ENV} - name: Add Latest Tag if: steps.is_prerelease.outputs.IS_PRERELEASE == 'false' run: | echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},${{ env.DOCKER_IMAGE }}:latest" >> ${GITHUB_ENV} + echo "DOCKER_TAGS_CLOUD=${{ env.DOCKER_TAGS_CLOUD }},${{ env.DOCKER_IMAGE_CLOUD }}:latest" >> ${GITHUB_ENV} - name: Create Release id: create_release uses: actions/create-release@v1 @@ -89,7 +92,7 @@ jobs: uses: smallstep/workflows/.github/workflows/docker-buildx-push.yml@main with: platforms: linux/amd64,linux/arm64 - tags: ${{ needs.create_release.outputs.docker_tags }} + tags: ${{ needs.create_release.outputs.docker_tags_cloud }} docker_image: smallstep/step-kms-plugin-cloud docker_file: docker/Dockerfile.cloud secrets: inherit From 7a2401c6b5c589ce189c8bf96f12654db5183d3e Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 26 Jan 2023 14:17:37 -0800 Subject: [PATCH 3/3] Add docker_tags_cloud output --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15cba68..b02cad7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: version: ${{ steps.extract-tag.outputs.VERSION }} is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} docker_tags: ${{ env.DOCKER_TAGS }} + docker_tags_cloud: ${{ env.DOCKER_TAGS_CLOUD }} steps: - name: Is Pre-release id: is_prerelease