forked from TrueCloudLab/certificates
Merge pull request #1243 from smallstep/remove-deprecated-binaries
Add step-kms-plugin to docker images and build a CGO based one
This commit is contained in:
commit
197b79bb48
3 changed files with 27 additions and 1 deletions
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
|
@ -17,10 +17,12 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: smallstep/step-ca
|
DOCKER_IMAGE: smallstep/step-ca
|
||||||
|
DOCKER_IMAGE_HSM: smallstep/step-ca-hsm
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.extract-tag.outputs.VERSION }}
|
version: ${{ steps.extract-tag.outputs.VERSION }}
|
||||||
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
|
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
|
||||||
docker_tags: ${{ env.DOCKER_TAGS }}
|
docker_tags: ${{ env.DOCKER_TAGS }}
|
||||||
|
docker_tags_hsm: ${{ env.DOCKER_TAGS_HSM }}
|
||||||
steps:
|
steps:
|
||||||
- name: Is Pre-release
|
- name: Is Pre-release
|
||||||
id: is_prerelease
|
id: is_prerelease
|
||||||
|
@ -36,10 +38,12 @@ jobs:
|
||||||
VERSION=${GITHUB_REF#refs/tags/v}
|
VERSION=${GITHUB_REF#refs/tags/v}
|
||||||
echo "VERSION=${VERSION}" >> ${GITHUB_OUTPUT}
|
echo "VERSION=${VERSION}" >> ${GITHUB_OUTPUT}
|
||||||
echo "DOCKER_TAGS=${{ env.DOCKER_IMAGE }}:${VERSION}" >> ${GITHUB_ENV}
|
echo "DOCKER_TAGS=${{ env.DOCKER_IMAGE }}:${VERSION}" >> ${GITHUB_ENV}
|
||||||
|
echo "DOCKER_TAGS_HSM=${{ env.DOCKER_IMAGE_HSM }}:${VERSION}" >> ${GITHUB_ENV}
|
||||||
- name: Add Latest Tag
|
- name: Add Latest Tag
|
||||||
if: steps.is_prerelease.outputs.IS_PRERELEASE == 'false'
|
if: steps.is_prerelease.outputs.IS_PRERELEASE == 'false'
|
||||||
run: |
|
run: |
|
||||||
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},${{ env.DOCKER_IMAGE }}:latest" >> ${GITHUB_ENV}
|
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},${{ env.DOCKER_IMAGE }}:latest" >> ${GITHUB_ENV}
|
||||||
|
echo "DOCKER_TAGS_HSM=${{ env.DOCKER_TAGS_HSM }},${{ env.DOCKER_IMAGE_HSM }}:latest" >> ${GITHUB_ENV}
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
|
@ -96,5 +100,19 @@ jobs:
|
||||||
platforms: linux/amd64,linux/386,linux/arm,linux/arm64
|
platforms: linux/amd64,linux/386,linux/arm,linux/arm64
|
||||||
tags: ${{ needs.create_release.outputs.docker_tags }}
|
tags: ${{ needs.create_release.outputs.docker_tags }}
|
||||||
docker_image: smallstep/step-ca
|
docker_image: smallstep/step-ca
|
||||||
docker_file: docker/Dockerfile.step-ca
|
docker_file: docker/Dockerfile
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
build_upload_docker_hsm:
|
||||||
|
name: Build & Upload HSM Enabled 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/386,linux/arm,linux/arm64
|
||||||
|
tags: ${{ needs.create_release.outputs.docker_tags_hsm }}
|
||||||
|
docker_image: smallstep/step-ca-hsm
|
||||||
|
docker_file: docker/Dockerfile.hsm
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
|
@ -7,9 +7,12 @@ RUN apk add --no-cache curl git make
|
||||||
RUN make V=1 download
|
RUN make V=1 download
|
||||||
RUN make V=1 bin/step-ca
|
RUN make V=1 bin/step-ca
|
||||||
|
|
||||||
|
FROM smallstep/step-kms-plugin-cloud:latest AS kms
|
||||||
|
|
||||||
FROM smallstep/step-cli:latest
|
FROM smallstep/step-cli:latest
|
||||||
|
|
||||||
COPY --from=builder /src/bin/step-ca /usr/local/bin/step-ca
|
COPY --from=builder /src/bin/step-ca /usr/local/bin/step-ca
|
||||||
|
COPY --from=kms /usr/local/bin/step-kms-plugin /usr/local/bin/step-kms-plugin
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
RUN apk add --no-cache libcap && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/step-ca
|
RUN apk add --no-cache libcap && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/step-ca
|
|
@ -8,13 +8,18 @@ RUN apk add --no-cache gcc musl-dev pkgconf pcsc-lite-dev
|
||||||
RUN make V=1 download
|
RUN make V=1 download
|
||||||
RUN make V=1 GOFLAGS="" build
|
RUN make V=1 GOFLAGS="" build
|
||||||
|
|
||||||
|
FROM smallstep/step-kms-plugin:latest AS kms
|
||||||
|
|
||||||
FROM smallstep/step-cli:latest
|
FROM smallstep/step-cli:latest
|
||||||
|
|
||||||
COPY --from=builder /src/bin/step-ca /usr/local/bin/step-ca
|
COPY --from=builder /src/bin/step-ca /usr/local/bin/step-ca
|
||||||
|
COPY --from=kms /usr/local/bin/step-kms-plugin /usr/local/bin/step-kms-plugin
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
RUN apk add --no-cache libcap && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/step-ca
|
RUN apk add --no-cache libcap && setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/step-ca
|
||||||
RUN apk add --no-cache pcsc-lite pcsc-lite-libs
|
RUN apk add --no-cache pcsc-lite pcsc-lite-libs
|
||||||
|
RUN mkdir -p /run/pcscd
|
||||||
|
RUN chown step:step /run/pcscd
|
||||||
USER step
|
USER step
|
||||||
|
|
||||||
ENV CONFIGPATH="/home/step/config/ca.json"
|
ENV CONFIGPATH="/home/step/config/ca.json"
|
Loading…
Reference in a new issue