@@ -18,12 +18,19 @@ FROM python:3.9 AS py39
18
18
19
19
RUN echo "${PYTHON_VERSION}" > /tmp/py39-latest
20
20
21
+ # #------------------------------------------------------------------------------
22
+ FROM python:3.10 AS py310
23
+
24
+ RUN echo "${PYTHON_VERSION}" > /tmp/py310-latest
25
+
21
26
# #------------------------------------------------------------------------------
22
27
FROM centos:7 AS base
23
28
29
+ # EPEL needed for openssl 1.1.x
24
30
RUN yum clean all \
25
31
&& yum update -y \
26
32
&& yum install -y \
33
+ epel-release \
27
34
nmap-ncat \
28
35
unixODBC \
29
36
&& yum clean all \
@@ -42,6 +49,15 @@ RUN yum-builddep -y python3
42
49
RUN yum install -y \
43
50
unixODBC-devel
44
51
52
+ # Python >= 3.10 needs openssl 1.1.x
53
+ RUN yum install -y \
54
+ openssl11-devel
55
+
56
+ RUN mkdir /usr/local/openssl11 \
57
+ && cd /usr/local/openssl11 \
58
+ && ln -s /usr/lib64/openssl11 lib \
59
+ && ln -s /usr/include/openssl11 include
60
+
45
61
RUN mkdir /src
46
62
47
63
# #------------------------------------------------------------------------------
@@ -61,7 +77,7 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
61
77
62
78
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
63
79
&& cd "/tmp/Python-${PYTHON_VERSION}" \
64
- && ./configure --prefix=/opt/py${py_ver} \
80
+ && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
65
81
&& make install
66
82
67
83
USER root
@@ -94,7 +110,7 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
94
110
95
111
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
96
112
&& cd "/tmp/Python-${PYTHON_VERSION}" \
97
- && ./configure --prefix=/opt/py${py_ver} \
113
+ && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
98
114
&& make install
99
115
100
116
USER root
@@ -127,7 +143,40 @@ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
127
143
128
144
RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
129
145
&& cd "/tmp/Python-${PYTHON_VERSION}" \
130
- && ./configure --prefix=/opt/py${py_ver} \
146
+ && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
147
+ && make install
148
+
149
+ USER root
150
+ ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
151
+ RUN pip3 install tox
152
+ USER ${nonroot_uid}
153
+
154
+ ENV HOME=/src
155
+ ENV PATH=/opt/py${py_ver}/bin:"${PATH}"
156
+ WORKDIR /src
157
+
158
+ ADD django_informixdb_vault/ /src/django_informixdb_vault/
159
+ ADD README.rst setup.* tox.ini /src/
160
+ RUN tox -e "$(tox --listenvs | grep py${py_ver} | tr '\n ' ',')" --notest # prep venvs
161
+
162
+ # #------------------------------------------------------------------------------
163
+ FROM builder-base AS builder-py310
164
+ ARG py_ver=310
165
+ ARG nonroot_uid
166
+ COPY --from=py310 /tmp/py${py_ver}-latest /tmp/
167
+
168
+ RUN mkdir /opt/py${py_ver} && chown -R ${nonroot_uid} /opt/py${py_ver} /src
169
+ USER ${nonroot_uid}
170
+ WORKDIR /tmp
171
+
172
+ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
173
+ && curl --silent --show-error --fail --location \
174
+ "https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz" \
175
+ | tar -xz
176
+
177
+ RUN export PYTHON_VERSION="$(cat /tmp/py${py_ver}-latest)" \
178
+ && cd "/tmp/Python-${PYTHON_VERSION}" \
179
+ && ./configure --prefix=/opt/py${py_ver} --with-openssl=/usr/local/openssl11 \
131
180
&& make install
132
181
133
182
USER root
@@ -167,6 +216,10 @@ COPY --from=builder-py39 /opt/py39/ /opt/py39/
167
216
COPY --from=builder-py39 /src/.tox/ /src/.tox/
168
217
COPY --from=builder-py39 /src/.cache/ /src/.cache/
169
218
219
+ COPY --from=builder-py310 /opt/py310/ /opt/py310/
220
+ COPY --from=builder-py310 /src/.tox/ /src/.tox/
221
+ COPY --from=builder-py310 /src/.cache/ /src/.cache/
222
+
170
223
ADD wait-for-deps.sh /usr/local/bin
171
224
RUN chmod a+rx /usr/local/bin/wait-for-deps.sh
172
225
@@ -175,7 +228,7 @@ ADD --chown=${nonroot_uid} django_informixdb_vault/ /src/django_informixdb_vault
175
228
ADD --chown=${nonroot_uid} test/ /src/test/
176
229
RUN chown ${nonroot_uid} /src
177
230
178
- ENV PATH=/opt/py39/bin:/opt/py38/bin:/opt/py37/bin:"${PATH}"
231
+ ENV PATH=/opt/py310/bin:/opt/ py39/bin:/opt/py38/bin:/opt/py37/bin:"${PATH}"
179
232
RUN pip3 --no-cache-dir install tox
180
233
181
234
USER ${nonroot_uid}
0 commit comments