Skip to content

Commit 731bbbf

Browse files
committed
Add wolfi image with boringcrypto
This PR adds a new docker image using wolfi with step-kms-plugin compiled with boringcrypto
1 parent 4ecaf53 commit 731bbbf

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ jobs:
1919
DOCKER_IMAGE: smallstep/step-kms-plugin
2020
CLOUD_TAG: cloud
2121
DEBIAN_TAG: bullseye
22+
WOLFI_TAG: wolfi
2223
outputs:
2324
version: ${{ steps.extract-tag.outputs.VERSION }}
2425
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
2526
docker_tags: ${{ env.DOCKER_TAGS }}
2627
docker_tags_cloud: ${{ env.DOCKER_TAGS_CLOUD }}
2728
docker_tags_debian: ${{ env.DOCKER_TAGS_DEBIAN }}
29+
docker_tags_wolfi: ${{ env.DOCKER_TAGS_WOLFI }}
2830
steps:
2931
- name: Is Pre-release
3032
id: is_prerelease
@@ -43,13 +45,15 @@ jobs:
4345
echo "DOCKER_TAGS=${{ env.DOCKER_IMAGE }}:${VERSION}" >> "${GITHUB_ENV}"
4446
echo "DOCKER_TAGS_CLOUD=${{ env.DOCKER_IMAGE }}:${VERSION}-${CLOUD_TAG}" >> "${GITHUB_ENV}"
4547
echo "DOCKER_TAGS_DEBIAN=${{ env.DOCKER_IMAGE }}:${VERSION}-${DEBIAN_TAG}" >> "${GITHUB_ENV}"
48+
echo "DOCKER_TAGS_WOLFI=${{ env.DOCKER_IMAGE }}:${VERSION}-${WOLFI_TAG}" >> "${GITHUB_ENV}"
4649
- name: Add Latest Tag
4750
if: steps.is_prerelease.outputs.IS_PRERELEASE == 'false'
4851
run: |
4952
# shellcheck disable=SC2129
5053
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},${{ env.DOCKER_IMAGE }}:latest" >> "${GITHUB_ENV}"
5154
echo "DOCKER_TAGS_CLOUD=${{ env.DOCKER_IMAGE }}:${CLOUD_TAG}" >> "${GITHUB_ENV}"
5255
echo "DOCKER_TAGS_DEBIAN=${{ env.DOCKER_IMAGE }}:${DEBIAN_TAG}" >> "${GITHUB_ENV}"
56+
echo "DOCKER_TAGS_WOLFI=${{ env.DOCKER_IMAGE }}:${WOLFI_TAG}" >> "${GITHUB_ENV}"
5357
- name: Create Release
5458
id: create_release
5559
uses: actions/create-release@v1
@@ -117,3 +121,17 @@ jobs:
117121
docker_image: smallstep/step-kms-plugin
118122
docker_file: docker/Dockerfile.cloud
119123
secrets: inherit
124+
125+
build_upload_docker_wolfi:
126+
name: Build & Upload Wolfi Docker Image
127+
needs: create_release
128+
permissions:
129+
id-token: write
130+
contents: write
131+
uses: smallstep/workflows/.github/workflows/docker-buildx-push.yml@main
132+
with:
133+
platforms: linux/amd64
134+
tags: ${{ needs.create_release.outputs.docker_tags_wolfi }}
135+
docker_image: smallstep/step-kms-plugin
136+
docker_file: docker/Dockerfile.wolfi
137+
secrets: inherit

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ build:
6262
$Q go build -v -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
6363
@echo "Build Complete!"
6464

65-
.PHONY: build
65+
build-fips:
66+
$Q GOEXPERIMENT="boringcrypto" go build -v -tags fips,noyubikey -o $(PREFIX)bin/$(BINNAME) $(LDFLAGS) $(PKG)
67+
@echo "Build Complete!"
68+
69+
.PHONY: build build-fips
6670

6771
#########################################
6872
# Go generate

cmd/fips.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2022 Smallstep Labs, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
//go:build fips
16+
// +build fips
17+
18+
package cmd
19+
20+
import _ "crypto/tls/fipsonly"

docker/Dockerfile.wolfi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM cgr.dev/chainguard/wolfi-base:latest AS builder
2+
3+
WORKDIR /src
4+
COPY . .
5+
6+
RUN apk update
7+
RUN apk add git make pkgconf gcc go
8+
RUN make V=1 build-fips
9+
10+
FROM cgr.dev/chainguard/wolfi-base:latest
11+
12+
COPY --from=builder /src/bin/step-kms-plugin /usr/bin/step-kms-plugin
13+
14+
USER root
15+
RUN apk update
16+
RUN apk add p11-kit
17+
18+
CMD ["/bin/sh"]

0 commit comments

Comments
 (0)