-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathDockerfile_rhel10
More file actions
121 lines (105 loc) · 3.88 KB
/
Copy pathDockerfile_rhel10
File metadata and controls
121 lines (105 loc) · 3.88 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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
FROM registry.access.redhat.com/ubi10/ubi:latest
# Enable the running user to own the build
ARG USER_ID=1001
ARG GROUP_ID=1002
ARG USER=cicd
ARG WORKSPACE=/workspace
RUN groupadd -g ${GROUP_ID} ${USER} || true && \
useradd -u ${USER_ID} -g ${GROUP_ID} -m ${USER} && \
mkdir -p ${WORKSPACE}/build \
${WORKSPACE}/lib \
${WORKSPACE}/logs \
${WORKSPACE}/output \
${WORKSPACE}/patches \
${WORKSPACE}/python \
${WORKSPACE}/src && \
chown -R ${USER}:${GROUP_ID} ${WORKSPACE}
# Install dependencies
ADD RPM-GPG-KEY-AlmaLinux-10 /etc/pki/rpm-gpg/
ADD *.repo /etc/yum.repos.d/
RUN sed -i '/^\[.*\]/a priority=1' /etc/yum.repos.d/ubi.repo
RUN dnf install -y dnf-plugins-core && \
dnf config-manager --set-enabled crb && \
dnf update -y && \
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm && \
dnf install -y --allowerasing --nobest \
binutils-devel \
cpio \
diffutils \
graphviz \
environment-modules \
file \
gnupg2 \
glibc-common \
isl-devel \
libgcc \
libmpc \
libmpc-devel \
libzstd \
libzstd-devel \
libzstd-static \
gcc \
gcc-c++ \
git \
isl \
make \
mpfr \
mpfr-devel \
patch \
perl \
perl-File-Copy \
perl-FindBin \
python3.12 \
python3.12-devel \
python3.12-pip \
unzip \
wget \
zlib-devel \
zlib-static \
zstd
# Install cmake from precompiled-binaries
RUN version=4.3.4 \
&& mkdir /tmp/temp \
&& cd /tmp/temp \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-linux-aarch64.tar.gz \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt \
&& sha256sum -c --ignore-missing cmake-$version-SHA-256.txt \
&& wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-SHA-256.txt.asc \
&& gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys C6C265324BBEBDC350B513D02D2CEF1034921684 \
&& gpg --verify cmake-$version-SHA-256.txt.asc cmake-$version-SHA-256.txt \
&& tar -xzvf cmake-$version-linux-aarch64.tar.gz -C /opt \
&& cd ~ && rm -rfv /tmp/temp \
&& alternatives \
--install /usr/local/bin/cmake cmake /opt/cmake-$version-linux-aarch64/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /opt/cmake-$version-linux-aarch64/bin/ctest \
--slave /usr/local/bin/cpack cpack /opt/cmake-$version-linux-aarch64/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /opt/cmake-$version-linux-aarch64/bin/ccmake \
--family cmake \
&& cmake --version \
&& ctest --version \
&& cpack --version
RUN ninja_version=1.12.1 \
&& wget https://github.com/ninja-build/ninja/releases/download/v$ninja_version/ninja-linux-aarch64.zip \
&& unzip ninja-linux-aarch64.zip \
&& mv ninja /usr/bin \
&& rm ninja-linux-aarch64.zip
RUN ln -fs /usr/bin/python3.12 /usr/bin/python && \
ln -fs /usr/bin/python3.12 /usr/bin/python3
ADD pyproject.toml poetry.lock ${WORKSPACE}/python/
WORKDIR ${WORKSPACE}/python
RUN python3.12 -m pip install --no-cache-dir poetry \
&& poetry config virtualenvs.in-project true \
&& poetry install --no-root --no-interaction --no-ansi
ENV PATH="${WORKSPACE}/python/.venv/bin:$PATH"
ENV PYTHON_HOME=${WORKSPACE}/python/.venv
# On some of our machines, the host configuration created issues with the permissions of the filesystem
# Those permission issues prevented the normal initialization of the modules
RUN echo "source /usr/share/Modules/init/bash" >> /home/${USER}/.bashrc
# Copy the entrypoint into the container and make it executable
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
WORKDIR ${WORKSPACE}
# Set the user to run the build
USER ${USER}
# Run the entrypoint
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]