forked from openshift/monitoring-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.mcp
More file actions
51 lines (35 loc) · 1.17 KB
/
Dockerfile.mcp
File metadata and controls
51 lines (35 loc) · 1.17 KB
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
FROM registry.redhat.io/ubi9/nodejs-22:latest AS web-builder
WORKDIR /opt/app-root
USER 0
ENV HUSKY=0
COPY web/package*.json web/
COPY Makefile Makefile
RUN cd web && npm ci --legacy-peer-deps --ignore-scripts
COPY web/ web/
COPY config/ config/
COPY scripts/update-plugin-name.sh scripts/update-plugin-name.sh
RUN make update-plugin-name
ENV I18N_NAMESPACE="plugin__monitoring-console-plugin"
RUN make build-frontend
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24 as go-builder
WORKDIR /opt/app-root
COPY Makefile Makefile
COPY go.mod go.mod
COPY go.sum go.sum
RUN make install-backend
COPY cmd/ cmd/
COPY pkg/ pkg/
ENV GOOS=${TARGETOS:-linux}
ENV GOARCH=${TARGETARCH}
ENV GOEXPERIMENT=strictfipsruntime
ENV GOFLAGS=-mod=readonly
ENV CGO_ENABLED=1
RUN make build-backend
FROM registry.redhat.io/rhel9-4-els/rhel:9.4
RUN mkdir /licenses
COPY LICENSE /licenses/.
USER 1001
COPY --from=web-builder /opt/app-root/web/dist /opt/app-root/web/dist
COPY --from=go-builder /opt/app-root/plugin-backend /opt/app-root
COPY --from=web-builder /opt/app-root/config /opt/app-root/config
ENTRYPOINT ["/opt/app-root/plugin-backend", "-static-path", "/opt/app-root/web/dist"]