Repository navigation
Expand file tree
/
Copy pathDockerfile.source-objectbucket.rhel9
More file actions
52 lines (44 loc) · 2.09 KB
/
Copy pathDockerfile.source-objectbucket.rhel9
File metadata and controls
52 lines (44 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Build the manager binary
ARG GO_BUILDER=registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.26-openshift-5.0
ARG GO_RUNTIME=registry.access.redhat.com/ubi9/ubi-minimal@sha256:6f3a78179e0b30b930a186e7f68a4af52e51bb82406c9653be10bddd624e40f5
FROM $GO_BUILDER AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /workspace
# The builder image defaults GOFLAGS to -mod=vendor, but this repo's
# dependencies aren't vendored into the build context, so switch back to
# normal module mode.
ENV GOFLAGS=''
# FIPS-compliant build, matching knative.dev/func's rhel9 images.
ENV CGO_ENABLED=1
ENV GOEXPERIMENT=strictfipsruntime
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# Copy the go source
COPY cmd/objectbucket-notifications-adapter/main.go cmd/objectbucket-notifications-adapter/main.go
COPY api/ api/
COPY internal/ internal/
# Build
RUN if [ -f /cachi2/cachi2.env ]; then source /cachi2/cachi2.env; fi && \
GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a \
-tags strictfipsruntime,exclude_graphdriver_btrfs \
-o manager cmd/objectbucket-notifications-adapter/main.go
# Use UBI as minimal base image to package the manager binary
FROM $GO_RUNTIME
WORKDIR /
COPY --from=builder /workspace/manager .
COPY LICENSE /licenses/
USER 65532:65532
LABEL name="openshift-serverless-tech-preview/objectbucket-notifications-adapter-rhel9" \
com.redhat.component="openshift-serverless-functions-operator-sources-objectbucket-container" \
version="2.0" \
release="1" \
summary="OpenShift Serverless Functions ObjectBucket Source container" \
description="Provides an integration with OpenShift Data Foundation bucket notifications" \
io.k8s.display-name="OpenShift Serverless Functions ObjectBucket Source container" \
io.k8s.description="Provides an integration with OpenShift Data Foundation bucket notifications" \
io.openshift.tags="openshift,serverless,functions,objectbucket,bucket,source" \
maintainer="serverless-support@redhat.com" \
cpe="cpe:/a:redhat:openshift_serverless:2.0::el9"
ENTRYPOINT ["/manager"]