-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile.ci-operator-buildroot
More file actions
58 lines (48 loc) · 2.2 KB
/
Dockerfile.ci-operator-buildroot
File metadata and controls
58 lines (48 loc) · 2.2 KB
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
# This Docker image is used for testing via the OpenShift CI workflow.
#
# To build this image, run the following command in project root directory:
# docker build -t ci-operator-buildroot --progress plain - < docker/Dockerfile.ci-operator-buildroot
FROM quay.io/centos/centos:stream9
# Disable color output to make log files more readable.
ENV NO_COLOR=1
# Update the system and install the necessary system packages.
# Note that ci-operator requires git to be installed on the system.
# https://docs.ci.openshift.org/docs/architecture/ci-operator/#build-root-image
RUN dnf update -y && \
dnf install -y git jq openssl procps-ng && \
git config --system --add safe.directory '*' && \
git config --system advice.detachedHead false
# Create /go directory and make it accessible to users in the root group.
# Note that ci-operator requires /go directory to exist with write permission.
# https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images
RUN mkdir /go && \
chgrp -R 0 /go && \
chmod -R g=u /go
# Configure npm package manager (installed below) via environment variables.
# https://docs.npmjs.com/cli/v8/using-npm/config#environment-variables
ENV npm_config_cache=/go/.npm \
npm_config_update_notifier=false
# Install Node.js via Node Version Manager.
# This also updates npm package manager to the latest available version.
# https://github.com/nvm-sh/nvm#manual-install
ENV NVM_DIR=/go/.nvm \
NVM_VERSION=v0.40.3 \
NODE_VERSION=v22.18.0 \
NPM_VERSION=10.9.3
RUN git clone -b $NVM_VERSION --depth 1 https://github.com/nvm-sh/nvm.git $NVM_DIR && \
. $NVM_DIR/nvm.sh && \
nvm install $NODE_VERSION && \
npm install -g npm@$NPM_VERSION
ENV PATH=$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
# Install global npm package dependencies.
RUN npm install -g yarn
# Install Cypress related dependencies.
# https://docs.cypress.io/app/get-started/install-cypress#Linux-Prerequisites
RUN dnf install -y xorg-x11-server-Xvfb gtk3-devel nss alsa-lib
# Clean up temporary files.
RUN dnf clean all
# Print post-build system information.
RUN echo "node $(node -v)" && \
echo "npm $(npm -v)" && \
echo "yarn $(yarn -v)" && \
openssl version