github.com/redhat-appstudio/release-service@v0.0.0-20240507045911-a8558ef3422a/Dockerfile (about) 1 # Build the manager binary 2 FROM registry.access.redhat.com/ubi9/go-toolset:1.20 as builder 3 4 # Copy the Go Modules manifests 5 COPY go.mod go.mod 6 COPY go.sum go.sum 7 # cache deps before building and copying source so that we don't need to re-download as much 8 # and so that source changes don't invalidate our downloaded layer 9 RUN go mod download 10 11 # Copy the go source 12 COPY main.go main.go 13 COPY api/ api/ 14 COPY cache/ cache/ 15 COPY controllers/ controllers/ 16 COPY loader/ loader/ 17 COPY metadata/ metadata/ 18 COPY metrics/ metrics/ 19 COPY syncer/ syncer/ 20 COPY tekton/ tekton/ 21 22 # Build 23 RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go 24 25 ARG ENABLE_WEBHOOKS=true 26 ENV ENABLE_WEBHOOKS=${ENABLE_WEBHOOKS} 27 28 # Use ubi-micro as minimal base image to package the manager binary 29 # See https://catalog.redhat.com/software/containers/ubi9/ubi-micro/615bdf943f6014fa45ae1b58 30 FROM registry.access.redhat.com/ubi9/ubi-micro:9.3-9 31 COPY --from=builder /opt/app-root/src/manager / 32 33 # It is mandatory to set these labels 34 LABEL name="Konflux Release Service" 35 LABEL description="Konflux Release Service" 36 LABEL io.k8s.description="Konflux Release Service" 37 LABEL io.k8s.display-name="release-service" 38 LABEL summary="Konflux Release Service" 39 LABEL com.redhat.component="release-service" 40 41 USER 65532:65532 42 43 ENTRYPOINT ["/manager"]