forked from application-stacks/runtime-component-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (31 loc) · 1.12 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
# Build the manager binary
FROM golang:1.16 as builder
ARG GO_ARCH=amd64
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor/ vendor/
# 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
COPY main.go main.go
COPY api/ api/
COPY controllers/ controllers/
COPY common/ common/
COPY utils/ utils/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$GO_ARCH GO111MODULE=on go build -ldflags="-s -w" -mod vendor -a -o manager main.go
#Build final image
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
LABEL vendor="Runtime Component Community" \
name="Runtime Component Operator" \
version="0.8.1" \
summary="Image for Runtime Component Operator" \
description="This image contains the controller for Runtime Component Operator. See https://github.com/application-stacks/runtime-component-operator"
COPY LICENSE /licenses/
WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532
ENTRYPOINT ["/manager"]