From 4d741aabbd90be1f0f83ad57ac590bf39466d19e Mon Sep 17 00:00:00 2001 From: Ugo Palatucci Date: Tue, 14 Apr 2026 10:25:55 +0200 Subject: [PATCH] Align Dockerfile.art with 4.22 base images and npm build - Use rhel-9-base-nodejs-openshift-4.22 and base-rhel9 4.22 images - Replace Cachito/REMOTE_SOURCES yarn bootstrap with npm ci - Set CYPRESS_INSTALL_BINARY=0 for CI builds - Use dnf for clean all; fix non-root user comment typo Made-with: Cursor --- Dockerfile.art | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/Dockerfile.art b/Dockerfile.art index 9eaf025..9539129 100644 --- a/Dockerfile.art +++ b/Dockerfile.art @@ -3,25 +3,10 @@ FROM registry.ci.openshift.org/ocp/builder:rhel-9-base-nodejs-openshift-4.21 AS # Copy app source COPY . /opt/app-root/src/app -COPY $REMOTE_SOURCES $REMOTE_SOURCES_DIR WORKDIR /opt/app-root/src/app -# 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 -RUN test -d ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps || exit 1; \ - cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/{.npmrc,.yarnrc,yarn.lock,registry-ca.pem} . \ - && source ${REMOTE_SOURCES_DIR}/cachito-gomod-with-deps/cachito.env \ - && npm ci && npm run build +# Install dependencies and build +RUN CYPRESS_INSTALL_BINARY=0 npm ci && npm run build # Web server container FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 @@ -29,11 +14,11 @@ FROM registry.ci.openshift.org/ocp/4.21:base-rhel9 RUN INSTALL_PKGS="nginx" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \ + dnf -y clean all --enablerepo='*' && rm -rf /var/cache/dnf/* && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run -# Use none-root user +# Use non-root user USER 1001 COPY --from=build /opt/app-root/src/app/dist /opt/app-root/src