Skip to content

Commit 2b94703

Browse files
committed
ci: minor cleanup
1 parent 9ca3203 commit 2b94703

8 files changed

Lines changed: 25 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ jobs:
5353
strategy:
5454
matrix:
5555
SOFTHSM_VERSION: [ "latest", "develop" ]
56-
DOCKER_BASE_IMAGE:
57-
- ghcr.io/dockerhub-mirror/alpine:latest
58-
- ghcr.io/dockerhub-mirror/debian:stable-slim
56+
DOCKER_BASE_IMAGE: [ alpine:latest, "debian:stable-slim" ]
5957

6058
steps:
6159
- name: "Show: GitHub context"
@@ -148,7 +146,7 @@ jobs:
148146

149147
- name: Build ${{ env.DOCKER_REPO_NAME }}:${{ matrix.SOFTHSM_VERSION }}
150148
env:
151-
DOCKER_BASE_IMAGE: ${{ matrix.DOCKER_BASE_IMAGE }}
149+
DOCKER_BASE_IMAGE: ghcr.io/dockerhub-mirror/${{ matrix.DOCKER_BASE_IMAGE }}
152150
DOCKER_IMAGE_REPO: ${{ github.repository_owner }}/${{ env.DOCKER_REPO_NAME }}
153151
SOFTHSM_VERSION: ${{ matrix.SOFTHSM_VERSION }}
154152
TRIVY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
1+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
22
name: Stale issues
33

44
on:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
> **SoftHSM has been developed for development purposes only. Don't use in production!**
1818
19-
Docker image to run a virtual HSM (Hardware Security Module) network service based on [SoftHSM2](https://github.com/softhsm/SoftHSMv2) and
19+
Multi-arch Docker image to run a virtual HSM (Hardware Security Module) network service based on [SoftHSM2](https://github.com/softhsm/SoftHSMv2) and
2020
[pkcs11-proxy](https://github.com/SUNET/pkcs11-proxy/).
2121

2222
Client applications can communicate with the HSM via TCP/TLS using libpkcs11-proxy.so and an OpenSSL TLS-PSK:

build-image.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ image_name=${tags[0]}
8383
# build the image
8484
#################################################
8585
log INFO "Building docker image [$image_name]..."
86-
if [[ $OSTYPE == cygwin || $OSTYPE == msys ]]; then
86+
if [[ $OSTYPE == "cygwin" || $OSTYPE == "msys" ]]; then
8787
project_root=$(cygpath -w "$project_root")
8888
fi
8989

@@ -97,7 +97,7 @@ esac
9797
set -x
9898

9999
docker --version
100-
export DOCKER_BUILD_KIT=1
100+
export DOCKER_BUILDKIT=1
101101
export DOCKER_CLI_EXPERIMENTAL=1 # prevents "docker: 'buildx' is not a docker command."
102102

103103
# Register QEMU emulators for all architectures so Docker can run and build multi-arch images
@@ -111,6 +111,7 @@ echo "
111111

112112
docker buildx version # ensures buildx is enabled
113113
docker buildx create --config /etc/buildkitd.toml --use # prevents: error: multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")
114+
trap 'docker buildx stop' EXIT
114115
# shellcheck disable=SC2154,SC2046 # base_layer_cache_key is referenced but not assigned / Quote this to prevent word splitting
115116
docker buildx build "$project_root" \
116117
--file "image/$dockerfile" \
@@ -129,18 +130,17 @@ docker buildx build "$project_root" \
129130
--build-arg PKCS11_PROXY_SOURCE_URL="https://codeload.github.com/smallstep/pkcs11-proxy/tar.gz/refs/heads/master" \
130131
`#--build-arg PKCS11_PROXY_SOURCE_URL="https://codeload.github.com/scobiej/pkcs11-proxy/tar.gz/refs/heads/osx-openssl1-1"` \
131132
`#--build-arg PKCS11_PROXY_SOURCE_URL="https://codeload.github.com/SUNET/pkcs11-proxy/tar.gz/refs/heads/master"` \
132-
$(if [[ ${ACT:-} == true || ${DOCKER_PUSH:-} != true ]]; then \
133+
$(if [[ ${ACT:-} == "true" || ${DOCKER_PUSH:-} != "true" ]]; then \
133134
echo -n "--load --output type=docker"; \
134135
else \
135136
echo -n "--platform linux/amd64,linux/arm64" `# ,linux/arm/v7"`; \
136137
fi) \
137138
"${tag_args[@]}" \
138-
$(if [[ ${DOCKER_PUSH:-} == true ]]; then echo -n "--push"; fi) \
139+
$(if [[ ${DOCKER_PUSH:-} == "true" ]]; then echo -n "--push"; fi) \
139140
"$@"
140-
docker buildx stop
141141
set +x
142142

143-
if [[ ${DOCKER_PUSH:-} == true ]]; then
143+
if [[ ${DOCKER_PUSH:-} == "true" ]]; then
144144
docker image pull "$image_name"
145145
fi
146146

@@ -157,15 +157,15 @@ echo
157157
#################################################
158158
# perform security audit
159159
#################################################
160-
if [[ ${DOCKER_AUDIT_IMAGE:-1} == 1 ]]; then
160+
if [[ ${DOCKER_AUDIT_IMAGE:-1} == "1" ]]; then
161161
bash "$shared_lib/cmd/audit-image.sh" "$image_name"
162162
fi
163163

164164

165165
#################################################
166166
# push image to ghcr.io
167167
#################################################
168-
if [[ ${DOCKER_PUSH_GHCR:-} == true ]]; then
168+
if [[ ${DOCKER_PUSH_GHCR:-} == "true" ]]; then
169169
for tag in "${tags[@]}"; do
170170
set -x
171171
docker run --rm \

client.alpine.Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Copyright 2021 by Vegard IT GmbH, Germany, https://vegardit.com
1+
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
2+
# SPDX-FileContributor: Sebastian Thomschke
23
# SPDX-License-Identifier: Apache-2.0
3-
#
4-
# Author: Sebastian Thomschke, Vegard IT GmbH
5-
#
6-
# https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
4+
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
75

86
FROM alpine:latest
97

client.debian.Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Copyright 2021 by Vegard IT GmbH, Germany, https://vegardit.com
1+
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
2+
# SPDX-FileContributor: Sebastian Thomschke
23
# SPDX-License-Identifier: Apache-2.0
3-
#
4-
# Author: Sebastian Thomschke, Vegard IT GmbH
5-
#
6-
# https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
4+
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
75

86
FROM debian:stable-slim
97

image/init-token.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2021 by Vegard IT GmbH, Germany, https://vegardit.com
3+
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
4+
# SPDX-FileContributor: Sebastian Thomschke
45
# SPDX-License-Identifier: Apache-2.0
5-
#
6-
# Author: Sebastian Thomschke, Vegard IT GmbH
7-
#
8-
# https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
6+
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
97

108
# shellcheck disable=SC1091 # Not following: /opt/bash-init.sh was not specified as input
119
type -t log >/dev/null || source /opt/bash-init.sh

image/run.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2021 by Vegard IT GmbH, Germany, https://vegardit.com
3+
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
4+
# SPDX-FileContributor: Sebastian Thomschke
45
# SPDX-License-Identifier: Apache-2.0
5-
#
6-
# Author: Sebastian Thomschke, Vegard IT GmbH
7-
#
8-
# https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
6+
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-softhsm2-pkcs11-proxy
97

108
# shellcheck disable=SC1091 # Not following: /opt/bash-init.sh was not specified as input
11-
source /opt/bash-init.sh
9+
source /opt/bash-init.sh # https://github.com/vegardit/docker-shared/blob/v1/lib/bash-init.sh
1210

1311
#################################################
1412
# print header

0 commit comments

Comments
 (0)