forked from cloudnative-pg/cloudnative-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 1.01 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
# This builder stage it's only because we need a command
# to create a symlink and reduce the size of the image
FROM gcr.io/distroless/static-debian11:debug-nonroot as builder
ARG TARGETARCH
SHELL ["/busybox/sh", "-c"]
COPY --chown=nonroot:nonroot --chmod=0755 dist/manager/* bin/
RUN ln -sf bin/manager_${TARGETARCH} manager
FROM gcr.io/distroless/static-debian11:nonroot
ARG VERSION="dev"
ARG TARGETARCH
ENV SUMMARY="CloudNativePG Operator Container Image." \
DESCRIPTION="This Docker image contains CloudNativePG Operator."
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.display-name="$SUMMARY" \
io.k8s.description="$DESCRIPTION" \
name="CloudNativePG Operator" \
vendor="CloudNativePG Contributors" \
url="https://cloudnative-pg.io/" \
version="$VERSION" \
release="1"
WORKDIR /
USER nonroot:nonroot
# Needs to copy the entire content, otherwise, it will not
# copy the symlink properly.
COPY --from=builder /home/nonroot/ .
ENTRYPOINT ["/manager"]