New submgr parameter in configmap.yaml to control order checking of E2 message IEs
[ric-plt/ric-dep.git] / depRicKubernetesOperator / Dockerfile
1 # Build the manager binary\r
2 FROM golang:1.20 as builder\r
3 ARG TARGETOS\r
4 ARG TARGETARCH\r
5 \r
6 WORKDIR /workspace\r
7 # Copy the Go Modules manifests\r
8 COPY go.mod go.mod\r
9 COPY go.sum go.sum\r
10 # cache deps before building and copying source so that we don't need to re-download as much\r
11 # and so that source changes don't invalidate our downloaded layer\r
12 RUN go mod download\r
13 \r
14 # Copy the go source\r
15 COPY cmd/main.go cmd/main.go\r
16 COPY api/ api/\r
17 COPY internal/controller/ internal/controller/\r
18 \r
19 # Build\r
20 # the GOARCH has not a default value to allow the binary be built according to the host where the command\r
21 # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO\r
22 # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,\r
23 # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.\r
24 RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go\r
25 \r
26 # Use distroless as minimal base image to package the manager binary\r
27 # Refer to https://github.com/GoogleContainerTools/distroless for more details\r
28 FROM gcr.io/distroless/static:nonroot\r
29 WORKDIR /\r
30 COPY --from=builder /workspace/manager .\r
31 USER 65532:65532\r
32 \r
33 ENTRYPOINT ["/manager"]\r