-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ako-operator
36 lines (26 loc) · 1.12 KB
/
Dockerfile.ako-operator
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
ARG golang_src_repo=golang:latest
ARG ubi_src_repo=registry.access.redhat.com/ubi8/ubi:latest
# Build the ako-operator binary
FROM ${golang_src_repo} as builder
ENV BUILD_PATH="github.com/vmware/load-balancer-and-ingress-services-for-kubernetes"
RUN mkdir -p $GOPATH/src/$BUILD_PATH
COPY . $GOPATH/src/$BUILD_PATH
WORKDIR $GOPATH/src/$BUILD_PATH
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o $GOPATH/bin/ako-operator -mod=vendor $BUILD_PATH/ako-operator/
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM ${ubi_src_repo}
LABEL name="ako-operator"
LABEL summary="An AKO operator to deploy AKO controller"
LABEL version="v1.8.1"
LABEL release="1"
LABEL description="Manage configmap, statefulset and other artifacts for deploying AKO controller"
LABEL vendor="VMware"
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical
WORKDIR /
COPY LICENSE /licenses/
COPY --from=builder /go/bin/ako-operator .
RUN adduser nonroot
USER nonroot:nonroot
ENTRYPOINT ["/ako-operator"]