Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 3 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,19 @@ ADD . /go/src/github.com/openshift/console/
WORKDIR /go/src/github.com/openshift/console/
RUN ./build-backend.sh


##################################################
#
# nodejs frontend build
FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.18 AS nodebuilder

ADD . .

USER 0

ARG COREPACK_VERSION=0.34.6

# bootstrap corepack so we can install and run the other tools.
RUN CACHED_COREPACK=./artifacts/corepack-${COREPACK_VERSION}.tar.gz; \
if [ -f ${CACHED_COREPACK} ]; then \
npm install --global ${CACHED_COREPACK}; \
else \
npm install --global https://github.com/nodejs/corepack/releases/download/v${COREPACK_VERSION}/corepack.tgz; \
fi

RUN npx corepack enable

# assume our package manager is safe to download
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# The REMOTE_SOURCES value is set by the build system to indicate the location of the cachito-backed artifacts cache.
# As cachito might not be available in all environments, we need to make sure the value is set before trying to use it and
# that the COPY layer below doesn't fail. Setting it to be the Dockerfile itself is fairly safe, as it will always be
# available.
ARG REMOTE_SOURCES=./Dockerfile.product
ARG REMOTE_SOURCE_DIR=/tmp/remote-sources

COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR

# use dependencies provided by Cachito
RUN test -d ${REMOTE_SOURCES}/cachito-gomod-with-deps || exit 0; \
cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/registry-ca.pem . \
&& cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/frontend/{.npmrc,.yarnrc.yml,yarn.lock} frontend/

# prevent download of cypress binary as part of module installs
WORKDIR frontend
ENV CYPRESS_INSTALL_BINARY=0

# run the build
RUN container-entrypoint ./build-frontend.sh

RUN node .yarn/releases/yarn-4.12.0.cjs install --immutable && \
node .yarn/releases/yarn-4.12.0.cjs build

##################################################
#
Expand Down
4 changes: 4 additions & 0 deletions frontend/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ nodeLinker: node-modules

npmMinimalAgeGate: 3d

supportedArchitectures:
os: ["linux", "darwin"]
cpu: ["x64", "arm64", "s390x", "ppc64"]

yarnPath: .yarn/releases/yarn-4.12.0.cjs