-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
46 lines (32 loc) · 1.29 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
44
45
46
## Build
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS build
USER root
ADD . /app
RUN cd /app && CGO_ENABLED=0 go build -ldflags='-extldflags=-static' -o=projection ./cmd/consumer/main.go
RUN cd /app && CGO_ENABLED=0 go build -ldflags='-extldflags=-static' -o=onprem ./cmd/onprem/main.go
## Licenses
FROM registry.access.redhat.com/ubi9/go-toolset:1.21 AS licenses
ADD . /app
WORKDIR /app
RUN go install github.com/google/[email protected]
RUN ${HOME}/go/bin/go-licenses save --save_path /tmp/licenses ./...
## Runtime
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.2
ARG release=main
ARG version=latest
LABEL com.redhat.component assisted-events-stream
LABEL description "Pipeline processors for assisted installer service events"
LABEL summary "Pipeline processors for assisted installer service events"
LABEL io.k8s.description "Pipeline processors for assisted installer service events"
LABEL distribution-scope public
LABEL name assisted-events-stream
LABEL release ${release}
LABEL version ${version}
LABEL url https://github.com/openshift-assisted/assisted-events-stream
LABEL vendor "Red Hat, Inc."
LABEL maintainer "Red Hat"
COPY --from=licenses /tmp/licenses /licenses
COPY --from=build /app/projection /
COPY --from=build /app/onprem /
USER 1001:1001
ENTRYPOINT ["/projection"]