Skip to content

Commit 9773489

Browse files
committed
Add FIPS compliance
Changes: - Update Go to 1.22 - Update Dockerfile for FIPS compliance - Disable btrfs to prevent build error due to missing library btrfs/ioct.h
1 parent d5dd79b commit 9773489

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

.ci-operator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: release
33
namespace: openshift
4-
tag: rhel-8-golang-1.21-openshift-4.16
4+
tag: rhel-8-golang-1.22-openshift-4.16

.tekton/source-to-image-pull-request.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ spec:
2929
value: 5d
3030
- name: dockerfile
3131
value: Dockerfile
32+
- name: build-source-image
33+
value: "true"
34+
- name: hermetic
35+
value: "true"
36+
- name: build-platforms
37+
value:
38+
- linux/x86_64
39+
- linux/arm64
40+
- linux/ppc64le
41+
- linux/s390x
42+
- name: prefetch-input
43+
value: '{"packages": [{"type": "gomod"}]}'
3244
pipelineSpec:
3345
description: |
3446
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
@@ -82,7 +94,7 @@ spec:
8294
description: Execute the build with network isolation
8395
name: hermetic
8496
type: string
85-
- default: '{"packages": [{"type": "gomod"}], "flags": ["gomod-vendor-check"]}'
97+
- default: ""
8698
description: Build dependencies to be prefetched by Cachi2
8799
name: prefetch-input
88100
type: string
@@ -108,9 +120,6 @@ spec:
108120
type: string
109121
- default:
110122
- linux/x86_64
111-
- linux/arm64
112-
- linux/ppc64le
113-
- linux/s390x
114123
description: List of platforms to build the container images on. The available
115124
set of values is determined by the configuration of the multi-platform-controller.
116125
name: build-platforms

.tekton/source-to-image-push.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ spec:
2626
value: quay.io/redhat-user-workloads/ocp-tools-s2i-tenant/source-to-image:{{revision}}
2727
- name: dockerfile
2828
value: Dockerfile
29+
- name: build-source-image
30+
value: "true"
31+
- name: hermetic
32+
value: "true"
33+
- name: build-platforms
34+
value:
35+
- linux/x86_64
36+
- linux/arm64
37+
- linux/ppc64le
38+
- linux/s390x
39+
- name: prefetch-input
40+
value: '{"packages": [{"type": "gomod"}]}'
2941
pipelineSpec:
3042
description: |
3143
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
@@ -79,7 +91,7 @@ spec:
7991
description: Execute the build with network isolation
8092
name: hermetic
8193
type: string
82-
- default: '{"packages": [{"type": "gomod"}], "flags": ["gomod-vendor-check"]}'
94+
- default: ""
8395
description: Build dependencies to be prefetched by Cachi2
8496
name: prefetch-input
8597
type: string
@@ -105,9 +117,6 @@ spec:
105117
type: string
106118
- default:
107119
- linux/x86_64
108-
- linux/arm64
109-
- linux/ppc64le
110-
- linux/s390x
111120
description: List of platforms to build the container images on. The available
112121
set of values is determined by the configuration of the multi-platform-controller.
113122
name: build-platforms

Dockerfile

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
FROM registry.redhat.io/ubi8/go-toolset:1.22.7-5 AS builder
1+
FROM registry.access.redhat.com/ubi8/go-toolset@sha256:be796155c0908cd48375bf1f7150036bcd3ad415dfb6cae135f1cf184d61964c AS builder
22

33
ENV S2I_GIT_VERSION="1.5.0" \
44
S2I_GIT_MAJOR="1" \
55
S2I_GIT_MINOR="5"
66

7+
ENV GOEXPERIMENT=strictfipsruntime
8+
79
COPY . .
810

9-
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -mod=vendor -ldflags="-s -w" -o /tmp/s2i ./cmd/s2i
11+
RUN CGO_ENABLED=1 GO111MODULE=on go build -a -mod=vendor -ldflags="-s -w" -tags="strictfipsruntime exclude_graphdriver_btrfs" -o /tmp/s2i ./cmd/s2i
1012

11-
#
12-
# Runner Image
13-
#
1413

15-
FROM registry.redhat.io/ubi8/ubi-minimal:8.10-1130
14+
FROM registry.access.redhat.com/ubi8@sha256:37cdac4ec130a64050d6df4e1f2ef3f53868bea55d11f623d141f139ee342bd8
1615

1716
COPY --from=builder /tmp/s2i /usr/local/bin/s2i
1817

@@ -24,12 +23,12 @@ LABEL \
2423
name="source-to-image/source-to-image" \
2524
description="Source-to-Image is a builder image" \
2625
summary="Source-to-Image is a builder image" \
27-
version="1.4.1" \
26+
version="1.5.0" \
2827
vendor="Red Hat, Inc." \
2928
com.redhat.component="source-to-image-container" \
3029
maintainer="[email protected]" \
3130
io.k8s.description="Source-to-Image is a builder image" \
3231
io.k8s.display-name="Source-to-Image" \
3332
io.openshift.tags="source-to-image,s2i" \
3433
io.openshift.maintainer.product="OpenShift Container Platform" \
35-
io.openshift.maintainer.component="Source-to-Image" \
34+
io.openshift.maintainer.component="Source-to-Image"

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/openshift/source-to-image
22

3-
go 1.21.0
3+
go 1.22.0
44

55
require (
66
github.com/containers/image/v5 v5.31.1

0 commit comments

Comments
 (0)