-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.ci
58 lines (41 loc) · 1.43 KB
/
Dockerfile.ci
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
FROM registry.redhat.io/ubi9/ubi-minimal as web-builder
ENV APP_ROOT=/opt/app-root \
HOME=/opt/app-root/src \
NPM_RUN=start \
PLATFORM="el8" \
NODEJS_VERSION=18 \
NPM_RUN=start \
NAME=nodejs
ENV NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH
RUN INSTALL_PKGS="nodejs nodejs-nodemon npm findutils tar make" && \
microdnf module disable nodejs -y && \
microdnf module enable nodejs:$NODEJS_VERSION -y && \
microdnf --nodocs install $INSTALL_PKGS -y && \
microdnf clean all && \
rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*
WORKDIR ${HOME}
ENV HUSKY=0
COPY web/package*.json ${HOME}/web/
COPY Makefile Makefile
RUN make install-frontend-ci
COPY web/ ${HOME}/web
RUN make build-frontend
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 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 config/ config/
COPY cmd/ cmd/
COPY pkg/ pkg/
ENV GOEXPERIMENT=strictfipsruntime
ENV CGO_ENABLED=1
RUN make build-backend BUILD_OPTS="-tags strictfipsruntime"
FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
USER 1001
COPY --from=web-builder /opt/app-root/src/web/dist ./web/dist
COPY --from=go-builder /opt/app-root/plugin-backend ./
COPY --from=go-builder /opt/app-root/config ./config
ENTRYPOINT ["./plugin-backend"]