@@ -24,35 +24,36 @@ FROM python:3.10 AS py310
24
24
RUN echo "${PYTHON_VERSION}" > /tmp/py310-latest
25
25
26
26
# #------------------------------------------------------------------------------
27
- FROM centos:7 AS base
28
-
29
- # EPEL needed for openssl 1.1.x
30
- RUN yum clean all \
31
- && yum update -y \
32
- && yum install -y \
33
- epel-release \
34
- nmap-ncat \
35
- unixODBC \
36
- && yum clean all \
37
- && rm -rf /var/yum/cache
27
+ FROM rockylinux:9 AS base
28
+
29
+ RUN dnf makecache \
30
+ && dnf update -y \
31
+ && dnf install -y --allowerasing \
32
+ curl \
33
+ dnf-plugins-core \
34
+ && dnf config-manager --set-enabled crb \
35
+ && dnf install -y \
36
+ bzip2-devel \
37
+ findutils \
38
+ gcc \
39
+ gcc-c++ \
40
+ git \
41
+ libffi-devel \
42
+ make \
43
+ openssl-devel \
44
+ python-devel \
45
+ python3-pip \
46
+ wget \
47
+ xz \
48
+ zlib-devel \
49
+ sqlite-devel \
50
+ unixODBC-devel \
51
+ nc \
52
+ && dnf clean all
38
53
39
54
# #------------------------------------------------------------------------------
40
55
FROM base AS builder-base
41
56
42
- RUN yum install -y \
43
- make \
44
- yum-utils
45
-
46
- RUN yum-builddep -y python3
47
-
48
- # For pyodbc
49
- RUN yum install -y \
50
- unixODBC-devel
51
-
52
- # Python >= 3.10 needs openssl 1.1.x
53
- RUN yum install -y \
54
- openssl11-devel
55
-
56
57
RUN mkdir /usr/local/openssl11 \
57
58
&& cd /usr/local/openssl11 \
58
59
&& ln -s /usr/lib64/openssl11 lib \
@@ -77,8 +78,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
77
78
78
79
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
79
80
&& cd "/tmp/Python-${PYTHON_VERSION}" \
80
- && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
81
- && make install
81
+ && ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
82
+ && make -j 4 altinstall
82
83
83
84
USER root
84
85
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
@@ -110,8 +111,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
110
111
111
112
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
112
113
&& cd "/tmp/Python-${PYTHON_VERSION}" \
113
- && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
114
- && make install
114
+ && ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
115
+ && make -j 4 altinstall
115
116
116
117
USER root
117
118
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
@@ -143,8 +144,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
143
144
144
145
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
145
146
&& cd "/tmp/Python-${PYTHON_VERSION}" \
146
- && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
147
- && make install
147
+ && ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
148
+ && make -j 4 altinstall
148
149
149
150
USER root
150
151
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
@@ -176,8 +177,8 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
176
177
177
178
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
178
179
&& cd "/tmp/Python-${PYTHON_VERSION}" \
179
- && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
180
- && make install
180
+ && ./configure --prefix=/opt/py${py_ver} --enable-optimizations \
181
+ && make -j 4 altinstall
181
182
182
183
USER root
183
184
ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
0 commit comments