Skip to content

Commit ded9ba7

Browse files
committed
ci: sign images
Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
1 parent be4b964 commit ded9ba7

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.github/workflows/build-docker.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Set up Docker Buildx
2424
id: buildx
2525
uses: docker/setup-buildx-action@v3
26+
- name: Set up cosign
27+
uses: sigstore/cosign-installer@v3
28+
if: ${{ github.event_name != 'pull_request' }}
2629
- name: login to Docker Hub
2730
if: ${{ github.event_name != 'pull_request' }}
2831
uses: docker/login-action@v3
@@ -36,14 +39,28 @@ jobs:
3639
registry: quay.io
3740
username: ${{ secrets.QUAYIO_USERNAME }}
3841
password: ${{ secrets.QUAYIO_PASSWORD }}
42+
- name: Login to GitHub Container Registry
43+
if: ${{ github.event_name == 'pull_request' }}
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
3949
- name: Build and push
4050
uses: docker/bake-action@v5
51+
id: bake
4152
with:
4253
builder: ${{ steps.buildx.outputs.name }}
4354
workdir: dockerfiles
4455
provenance: true
4556
sbom: true
46-
push: ${{ github.event_name != 'pull_request' }}
57+
push: true
58+
targets: ktls-utils
4759
env:
4860
GIT_COMMIT: ${{ github.sha }}
4961
CACHE: true
62+
REGISTRIES: ghcr.io/piraeusdatastore
63+
- name: Sign images
64+
run: |
65+
jq '.[] | ."containerimage.digest" as $DIGEST | ."image.name" | split(",")[] | "\(.)@\($DIGEST)"' -r <<<'${{ steps.bake.outputs.metadata }}' \
66+
| xargs cosign sign --yes

dockerfiles/docker-bake.hcl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ variable VERSIONS {
2525
}
2626

2727
variable "REGISTRIES" {
28-
default = [
29-
"quay.io/piraeusdatastore",
30-
"docker.io/piraeusdatastore",
31-
]
28+
default = "quay.io/piraeusdatastore,docker.io/piraeusdatastore"
3229
}
3330

3431
# Replace all characters that are not supported in a target name with "-".
@@ -41,7 +38,7 @@ function "escape" {
4138
function "tags" {
4239
params = [name, version]
4340
result = flatten([
44-
for registry in REGISTRIES :
41+
for registry in split(",", REGISTRIES) :
4542
[
4643
// Full version
4744
"${registry}/${name}:v${version}",

dockerfiles/drbd-driver-loader/Dockerfile.centos7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM centos:centos7
22
MAINTAINER Roland Kammerer <roland.kammerer@linbit.com>
33

4-
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
4+
RUN sed -e 's/^mirrorlist=/#mirrorlist=/' -e 's%^#baseurl=http://mirror.centos.org%baseurl=http://vault.centos.org%' -i /etc/yum.repos.d/*.repo && \
5+
yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
56
yum install -y gcc make patch diffutils perl kmod && yum clean all -y
67

78
ARG DRBD_VERSION

0 commit comments

Comments
 (0)