-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.template
More file actions
64 lines (58 loc) · 2.8 KB
/
Dockerfile.template
File metadata and controls
64 lines (58 loc) · 2.8 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
FROM quay.io/pypa/manylinux_2_28_${architecture}
RUN yum update -y && yum install -y \
gcc-c++ \
ant \
zlib-devel \
perl-core \
ninja-build \
libsecret-devel \
bzip2-devel \
libffi-devel \
xz-devel \
openssl-devel \
sqlite-devel \
make \
tar
# Remove CMake 4.x that comes with manylinux_2_28 base image
# We need CMake 3.x because CMake 4.0 dropped support for older CMake syntax
# that some of our dependencies still require
RUN rm -f /usr/local/bin/cmake /usr/local/bin/ctest /usr/local/bin/cpack
# Install CMake 3.31.8 (latest 3.x version)
# Map Docker architecture to CMake architecture naming
RUN if [ "${architecture}" = "x86_64" ]; then \
CMAKE_ARCH="x86_64"; \
elif [ "${architecture}" = "aarch64" ]; then \
CMAKE_ARCH="aarch64"; \
else \
echo "Unsupported architecture: ${architecture}"; exit 1; \
fi && \
curl -L https://github.com/Kitware/CMake/releases/download/v3.31.8/cmake-3.31.8-linux-${CMAKE_ARCH}.tar.gz -o /tmp/cmake.tar.gz && \
cd /tmp && \
tar -xzf cmake.tar.gz && \
cp -r cmake-3.31.8-linux-${CMAKE_ARCH}/bin/* /usr/local/bin/ && \
cp -r cmake-3.31.8-linux-${CMAKE_ARCH}/share/* /usr/local/share/ && \
rm -rf /tmp/cmake*
# Use pre-installed Python from manylinux image
# The manylinux images already have Python versions in /opt/python/
# Create symlinks to make the Python version available system-wide
RUN PYVER_NO_DOT=$(echo ${pyver_short} | tr -d '.') && \
if [ -d /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT} ]; then \
# Create versioned symlinks
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/python /usr/local/bin/python${pyver_short} && \
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/pip /usr/local/bin/pip${pyver_short} && \
# Override the generic python3 to point to our specific version
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/python /usr/local/bin/python3 && \
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/pip /usr/local/bin/pip3 && \
# Also create python symlink for maximum compatibility
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/python /usr/local/bin/python && \
ln -sf /opt/python/cp${PYVER_NO_DOT}-cp${PYVER_NO_DOT}/bin/pip /usr/local/bin/pip && \
echo "Using pre-installed Python ${pyver_short}"; \
else \
echo "Python ${pyver_short} not found in /opt/python/"; \
exit 1; \
fi
# Ensure wheel is installed (should already be present in manylinux images)
RUN pip${pyver_short} install --upgrade pip wheel
# Set PATH to include the Python bin directory
# This ensures pip-installed executables (like conan) are available globally
ENV PATH=/usr/local/bin:/opt/python/cp${pyver_short_no_dot}-cp${pyver_short_no_dot}/bin:$PATH