-
Notifications
You must be signed in to change notification settings - Fork 66
/
Dockerfile
52 lines (43 loc) · 1.55 KB
/
Dockerfile
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
FROM golang:1.22 as builder
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
RUN go install golang.org/x/tools/cmd/goimports@latest
# Copy the go source & git info
COPY cmd/manager/main.go cmd/manager/main.go
COPY .git/ .git/
COPY pkg/ pkg/
COPY internal/ internal/
COPY Makefile Makefile
COPY config/ config/
COPY hack/ hack/
ARG VERSION
ARG TARGETOS
ARG TARGETARCH
ENV VERSION=${VERSION}
ENV TARGET_ARCH=${TARGETARCH}
ENV TARGET_OS=${TARGETOS}
RUN make manager
FROM registry.access.redhat.com/ubi9/ubi-micro:9.2
LABEL name="MongoDB Atlas Operator" \
maintainer="support@mongodb.com" \
vendor="MongoDB" \
release="1" \
summary="MongoDB Atlas Operator Image" \
description="MongoDB Atlas Operator is a Kubernetes Operator allowing to manage MongoDB Atlas resources not leaving Kubernetes cluster" \
io.k8s.display-name="MongoDB Atlas Operator" \
io.k8s.description="MongoDB Atlas Operator is a Kubernetes Operator allowing to manage MongoDB Atlas resources not leaving Kubernetes cluster" \
io.openshift.tags="mongodb,atlas" \
io.openshift.maintainer.product="MongoDB" \
License="Apache-2.0"
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY hack/licenses licenses
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
USER 1001:0
ENTRYPOINT ["/manager"]