forked from mongodb/mongodb-atlas-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
49 lines (39 loc) · 1.28 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
# Build the manager binary
FROM golang:1.17 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
# Copy the go source & git info
COPY cmd/manager/main.go cmd/manager/main.go
COPY .git/ .git/
COPY pkg/ pkg/
COPY Makefile Makefile
COPY config/ config/
COPY hack/ hack/
ARG VERSION
ENV PRODUCT_VERSION=${VERSION}
RUN make manager
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5-230
RUN microdnf install yum &&\
yum -y update &&\
yum clean all &&\
dnf remove python3-pip -y &&\
microdnf clean all
#FROM registry.access.redhat.com/ubi8/ubi
#
#RUN dnf -y update-minimal --security --sec-severity=Important --sec-severity=Critical
LABEL name="MongoDB Atlas Operator" \
maintainer="[email protected]" \
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"
WORKDIR /
COPY --from=builder /workspace/bin/manager .
COPY hack/licenses licenses
USER 1001:0
ENTRYPOINT ["/manager"]