-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
59 lines (40 loc) · 1.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
###################
## Build go binary
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9-1736729788 AS build
ARG BUILD_ARGS
USER root
WORKDIR /build
COPY go.mod .
COPY go.sum .
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,mode=0755,target=/go/pkg/mod GOOS=linux make build.local BUILD_ARGS="${BUILD_ARGS}"
############
## Licenses
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9-1736729788 AS licenses
ADD . /app
WORKDIR /app
RUN go install github.com/google/go-licenses@v1.6.0
RUN ${HOME}/go/bin/go-licenses save --save_path /tmp/licenses ./...
########################
## Create runtime image
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1736404155
ARG release=main
ARG version=latest
LABEL com.redhat.component ccx-exporter
LABEL description "Pipeline processors to export assisted installer events to s3"
LABEL summary "Pipeline processors to export assisted installer events to s3"
LABEL io.k8s.description "Pipeline processors to export assisted installer events to s3"
LABEL distribution-scope public
LABEL name ccx-exporter
LABEL release ${release}
LABEL version ${version}
LABEL url https://github.com/openshift-assisted/ccx-exporter
LABEL vendor "Red Hat, Inc."
LABEL maintainer "Red Hat"
COPY --from=build /build/build/ccx-exporter /usr/bin/ccx-exporter
COPY --from=licenses /tmp/licenses /licenses
# Metrics port
EXPOSE 7777
USER 1001:1001
ENTRYPOINT ["/usr/bin/ccx-exporter"]