-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile.art
53 lines (41 loc) · 1.87 KB
/
Dockerfile.art
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
FROM registry.ci.openshift.org/ocp/builder:rhel-8-openshift-nodejs-base-4.14.art AS web-builder
# Copy app sources
COPY . /opt/app-root/src/app
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR /opt/app-root/src/app/web
# bootstrap yarn so we can install and run the other tools.
USER 0
ARG YARN_VERSION=v1.22.19
RUN CACHED_YARN=../artifacts/yarn-${YARN_VERSION}.tar.gz; \
if [ -f ${CACHED_YARN} ]; then \
npm install -g ${CACHED_YARN}; \
else \
echo "need yarn at ${CACHED_YARN}"; \
exit 1; \
fi
# use dependencies provided by Cachito
ENV HUSKY=0
RUN test -d ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps || exit 1; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/web/{.npmrc,.yarnrc,yarn.lock} . \
&& cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/registry-ca.pem .. \
&& source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env \
&& yarn && yarn build
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.14 AS go-builder
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
WORKDIR /go/src/github.com/openshift/console-dashboards-plugin
COPY go.mod go.mod
COPY go.sum go.sum
COPY cmd/ cmd/
COPY pkg/ pkg/
COPY Makefile Makefile
RUN source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env && make build-backend
FROM registry.ci.openshift.org/ocp/4.14:base
COPY --from=web-builder /opt/app-root/src/app/web/dist /usr/share/web/dist
COPY --from=go-builder /go/src/github.com/openshift/console-dashboards-plugin/plugin-backend /usr/bin/plugin-backend
USER 1001
WORKDIR /usr/bin
LABEL io.k8s.display-name="OpenShift console dashboards plugin" \
io.k8s.description="This is an OpenShift console plugin to enhance dashboards." \
io.openshift.tags="openshift" \
maintainer="Observability UI Team <team-observability-ui@redhat.com>"
ENTRYPOINT ["/usr/bin/plugin-backend", "-static-path", "/usr/share/web/dist"]