-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContainerfile
57 lines (43 loc) · 1.74 KB
/
Containerfile
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
FROM registry.redhat.io/ubi9/nodejs-20:latest AS builder
WORKDIR /plugin-workspace
ENV PLUGINS_OUTPUT="/plugin-output"
ENV PLUGINS_WORKSPACE="/plugin-workspace"
ENV TURBO_TELEMETRY_DISABLED=1
USER root
COPY . .
# Remove local settings
RUN rm -f .npmrc
# The recommended way of using yarn is via corepack. However, corepack is not included in the UBI
# image. Below we install corepack so we can install yarn.
# https://github.com/nodejs/corepack?tab=readme-ov-file#default-installs
RUN \
node --version && \
npm install -g corepack && \
corepack --version && \
corepack enable yarn && \
corepack use 'yarn@4' && \
yarn --version && \
mkdir -p $PLUGINS_OUTPUT && \
dnf -y install jq
RUN yarn plugins:prepare && \
yarn plugins:build
RUN for plugin in $(ls ${PLUGINS_WORKSPACE}/plugins); do \
mv "${PLUGINS_WORKSPACE}/plugins/${plugin}/dist-plugin/index.json" "${PLUGINS_WORKSPACE}/plugins/${plugin}/dist-plugin/${plugin}-index.json" && \
cp -R ${PLUGINS_WORKSPACE}/plugins/${plugin}/dist-plugin/* ${PLUGINS_OUTPUT}; \
done && \
jq -c -s 'flatten' ${PLUGINS_OUTPUT}/*-index.json > ${PLUGINS_OUTPUT}/index.json && \
rm -f ${PLUGINS_OUTPUT}/*-index.json
RUN mkdir -p $PLUGINS_OUTPUT/licenses && \
cp $PLUGINS_WORKSPACE/LICENSE.TXT $PLUGINS_OUTPUT/licenses
FROM scratch
LABEL name="RHTAP backstage plugins" \
com.redhat.component="rhtap" \
vendor="Red Hat, Inc." \
version="1" \
release="5" \
description="Artifact with Backstage plugins for RHTAP" \
summary="Artifact with Backstage plugins for RHTAP" \
url="https://github.com/redhat-appstudio/backstage-community-plugins" \
distribution-scope="public"
COPY --chown=1001:1001 --from=builder /plugin-output /
USER 1001