-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathbrew.Dockerfile
84 lines (72 loc) · 3.89 KB
/
brew.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright (c) 2021-2024 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
# https://registry.access.redhat.com/ubi9/nodejs-18
FROM registry.redhat.io/ubi9/nodejs-18:9.5-1741891089 as builder
# hadolint ignore=DL3002
USER 0
RUN dnf -y -q update --exclude=unbound-libs
# https://docs.engineering.redhat.com/pages/viewpage.action?pageId=228017926#UpstreamSources%28Cachito,ContainerFirst%29-CachitoIntegrationforyarn
# CRW-4644 Use RedHat nodejs headers to prevent node-gyp from trying to download them
# hadolint ignore=DL3040,DL3059
RUN dnf module install -y nodejs:18/development
# cachito:yarn step 1: copy cachito sources where we can use them; source env vars; set working dir
COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR
# hadolint ignore=SC1091
RUN source "$REMOTE_SOURCES_DIR"/devspaces-images-dashboard/cachito.env
WORKDIR $REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/
# cachito:yarn step 2: workaround for yarn not being installed in an executable path
COPY .yarn/releases $REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/.yarn/releases/
RUN ln -s "$REMOTE_SOURCES_DIR"/devspaces-images-dashboard/app/devspaces-dashboard/.yarn/releases/yarn-*.js /usr/local/bin/yarn
# cachito:yarn step 3: configure yarn & install deps
# see https://source.redhat.com/groups/public/container-build-system/container_build_system_wiki/containers_from_source_multistage_builds_in_osbs#jive_content_id_Cachito_Integration_for_yarn
RUN source "$REMOTE_SOURCES_DIR"/devspaces-images-dashboard/cachito.env && \
yarn install --mode=skip-build
# CRW-8333 Lerna step no longer required in Cachi2
# cachito:yarn step 4: lerna installed to $REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/node_modules/.bin/lerna - add to path
# RUN ln -s "$REMOTE_SOURCES_DIR"/devspaces-images-dashboard/app/devspaces-dashboard/node_modules/.bin/lerna /usr/local/bin/lerna
# cachito:yarn step 5: the actual build!
# hadolint ignore=DL3059
RUN yarn build
# cachito:yarn step 6: cleanup (required only if not using a builder stage)
# RUN rm -rf $REMOTE_SOURCES_DIR
# https://registry.access.redhat.com/ubi9/nodejs-18
FROM registry.redhat.io/ubi9/nodejs-18:9.5-1741891089
# hadolint ignore=DL3002
USER 0
# hadolint ignore=DL4006
RUN \
yum -y -q update && \
yum -y -q clean all && rm -rf /var/cache/yum && \
echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages"
ENV FRONTEND_LIB=$REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/packages/dashboard-frontend/lib/public
ENV BACKEND_LIB=$REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/packages/dashboard-backend/lib
ENV DEVFILE_REGISTRY=$REMOTE_SOURCES_DIR/devspaces-images-dashboard/app/devspaces-dashboard/packages/devfile-registry
COPY --from=builder ${BACKEND_LIB} /backend
COPY --from=builder ${FRONTEND_LIB} /public
COPY --from=builder ${DEVFILE_REGISTRY} /public/dashboard/devfile-registry
COPY build/dockerfiles/rhel.entrypoint.sh /usr/local/bin
CMD ["/usr/local/bin/rhel.entrypoint.sh"]
## Append Brew metadata
ENV SUMMARY="Red Hat OpenShift Dev Spaces dashboard container" \
DESCRIPTION="Red Hat OpenShift Dev Spaces dashboard container" \
PRODNAME="devspaces" \
COMPNAME="dashboard-rhel9"
LABEL summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
io.k8s.display-name="$DESCRIPTION" \
io.openshift.tags="$PRODNAME,$COMPNAME" \
com.redhat.component="$PRODNAME-$COMPNAME-container" \
name="$PRODNAME/$COMPNAME" \
version="3.21" \
license="EPLv2" \
maintainer="Nick Boldt <[email protected]>" \
io.openshift.expose-services="" \
usage=""