File tree 15 files changed +62
-43
lines changed
15 files changed +62
-43
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,16 @@ ENV LANG C.UTF-8
15
15
# https://github.com/docker-library/python/issues/147
16
16
ENV PYTHONIOENCODING UTF-8
17
17
18
- # install libressl so that HTTPS works on Alpine <3.7
19
- RUN apk add --no-cache libressl
18
+ # install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
19
+ RUN apk add --no-cache ca-certificates
20
20
21
21
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
22
22
ENV PYTHON_VERSION 2.7.15
23
23
24
24
RUN set -ex \
25
25
&& apk add --no-cache --virtual .fetch-deps \
26
26
gnupg \
27
+ libressl \
27
28
tar \
28
29
xz \
29
30
\
@@ -46,6 +47,7 @@ RUN set -ex \
46
47
gcc \
47
48
gdbm-dev \
48
49
libc-dev \
50
+ libressl \
49
51
libressl-dev \
50
52
linux-headers \
51
53
make \
@@ -93,9 +95,13 @@ RUN set -ex \
93
95
ENV PYTHON_PIP_VERSION 18.0
94
96
95
97
RUN set -ex; \
98
+ \
99
+ apk add --no-cache --virtual .fetch-deps libressl; \
96
100
\
97
101
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
98
102
\
103
+ apk del .fetch-deps; \
104
+ \
99
105
python get-pip.py \
100
106
--disable-pip-version-check \
101
107
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ ENV LANG C.UTF-8
15
15
# https://github.com/docker-library/python/issues/147
16
16
ENV PYTHONIOENCODING UTF-8
17
17
18
- # install libressl so that HTTPS works on Alpine <3.7
19
- # RUN apk add --no-cache libressl
20
-
21
18
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
22
19
ENV PYTHON_VERSION 2.7.15
23
20
@@ -98,6 +95,8 @@ RUN set -ex; \
98
95
\
99
96
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
100
97
\
98
+ apk del .fetch-deps; \
99
+ \
101
100
python get-pip.py \
102
101
--disable-pip-version-check \
103
102
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ ENV LANG C.UTF-8
15
15
# https://github.com/docker-library/python/issues/147
16
16
ENV PYTHONIOENCODING UTF-8
17
17
18
- # install libressl so that HTTPS works on Alpine <3.7
19
- # RUN apk add --no-cache libressl
20
-
21
18
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
22
19
ENV PYTHON_VERSION 2.7.15
23
20
@@ -98,6 +95,8 @@ RUN set -ex; \
98
95
\
99
96
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
100
97
\
98
+ apk del .fetch-deps; \
99
+ \
101
100
python get-pip.py \
102
101
--disable-pip-version-check \
103
102
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
20
17
ENV PYTHON_VERSION 3.4.8
21
18
@@ -107,6 +104,8 @@ RUN set -ex; \
107
104
\
108
105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
109
106
\
107
+ apk del .fetch-deps; \
108
+ \
110
109
python get-pip.py \
111
110
--disable-pip-version-check \
112
111
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
20
17
ENV PYTHON_VERSION 3.4.8
21
18
@@ -107,6 +104,8 @@ RUN set -ex; \
107
104
\
108
105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
109
106
\
107
+ apk del .fetch-deps; \
108
+ \
110
109
python get-pip.py \
111
110
--disable-pip-version-check \
112
111
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
20
17
ENV PYTHON_VERSION 3.5.5
21
18
@@ -107,6 +104,8 @@ RUN set -ex; \
107
104
\
108
105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
109
106
\
107
+ apk del .fetch-deps; \
108
+ \
110
109
python get-pip.py \
111
110
--disable-pip-version-check \
112
111
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
20
17
ENV PYTHON_VERSION 3.5.5
21
18
@@ -107,6 +104,8 @@ RUN set -ex; \
107
104
\
108
105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
109
106
\
107
+ apk del .fetch-deps; \
108
+ \
110
109
python get-pip.py \
111
110
--disable-pip-version-check \
112
111
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,15 +13,16 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- RUN apk add --no-cache libressl
16
+ # install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
17
+ RUN apk add --no-cache ca-certificates
18
18
19
19
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
20
20
ENV PYTHON_VERSION 3.6.6
21
21
22
22
RUN set -ex \
23
23
&& apk add --no-cache --virtual .fetch-deps \
24
24
gnupg \
25
+ libressl \
25
26
tar \
26
27
xz \
27
28
\
@@ -46,6 +47,7 @@ RUN set -ex \
46
47
gdbm-dev \
47
48
libc-dev \
48
49
libffi-dev \
50
+ libressl \
49
51
libressl-dev \
50
52
linux-headers \
51
53
make \
@@ -104,9 +106,13 @@ RUN cd /usr/local/bin \
104
106
ENV PYTHON_PIP_VERSION 18.0
105
107
106
108
RUN set -ex; \
109
+ \
110
+ apk add --no-cache --virtual .fetch-deps libressl; \
107
111
\
108
112
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
109
113
\
114
+ apk del .fetch-deps; \
115
+ \
110
116
python get-pip.py \
111
117
--disable-pip-version-check \
112
118
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
20
17
ENV PYTHON_VERSION 3.6.6
21
18
@@ -109,6 +106,8 @@ RUN set -ex; \
109
106
\
110
107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
111
108
\
109
+ apk del .fetch-deps; \
110
+ \
112
111
python get-pip.py \
113
112
--disable-pip-version-check \
114
113
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
20
17
ENV PYTHON_VERSION 3.6.6
21
18
@@ -109,6 +106,8 @@ RUN set -ex; \
109
106
\
110
107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
111
108
\
109
+ apk del .fetch-deps; \
110
+ \
112
111
python get-pip.py \
113
112
--disable-pip-version-check \
114
113
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
20
17
ENV PYTHON_VERSION 3.7.0
21
18
@@ -109,6 +106,8 @@ RUN set -ex; \
109
106
\
110
107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
111
108
\
109
+ apk del .fetch-deps; \
110
+ \
112
111
python get-pip.py \
113
112
--disable-pip-version-check \
114
113
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ ENV PATH /usr/local/bin:$PATH
13
13
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14
14
ENV LANG C.UTF-8
15
15
16
- # install libressl so that HTTPS works on Alpine <3.7
17
- # RUN apk add --no-cache libressl
18
-
19
16
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
20
17
ENV PYTHON_VERSION 3.7.0
21
18
@@ -109,6 +106,8 @@ RUN set -ex; \
109
106
\
110
107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
111
108
\
109
+ apk del .fetch-deps; \
110
+ \
112
111
python get-pip.py \
113
112
--disable-pip-version-check \
114
113
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -7,15 +7,16 @@ ENV PATH /usr/local/bin:$PATH
7
7
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
8
8
ENV LANG C.UTF-8
9
9
10
- # install libressl so that HTTPS works on Alpine <3.7
11
- # RUN apk add --no-cache libressl
10
+ # install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
11
+ RUN apk add --no-cache ca-certificates
12
12
13
13
ENV GPG_KEY %%PLACEHOLDER%%
14
14
ENV PYTHON_VERSION %%PLACEHOLDER%%
15
15
16
16
RUN set -ex \
17
17
&& apk add --no-cache --virtual .fetch-deps \
18
18
gnupg \
19
+ libressl \
19
20
tar \
20
21
xz \
21
22
\
@@ -41,6 +42,7 @@ RUN set -ex \
41
42
libc-dev \
42
43
libffi-dev \
43
44
libnsl-dev \
45
+ libressl \
44
46
libressl-dev \
45
47
libtirpc-dev \
46
48
linux-headers \
@@ -100,9 +102,13 @@ RUN cd /usr/local/bin \
100
102
ENV PYTHON_PIP_VERSION %%PLACEHOLDER%%
101
103
102
104
RUN set -ex; \
105
+ \
106
+ apk add --no-cache --virtual .fetch-deps libressl; \
103
107
\
104
108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
105
109
\
110
+ apk del .fetch-deps; \
111
+ \
106
112
python get-pip.py \
107
113
--disable-pip-version-check \
108
114
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ ENV LANG C.UTF-8
9
9
# https://github.com/docker-library/python/issues/147
10
10
ENV PYTHONIOENCODING UTF-8
11
11
12
- # install libressl so that HTTPS works on Alpine <3.7
13
- # RUN apk add --no-cache libressl
12
+ # install ca-certificates so that HTTPS works consistently (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
13
+ RUN apk add --no-cache ca-certificates
14
14
15
15
ENV GPG_KEY %%PLACEHOLDER%%
16
16
ENV PYTHON_VERSION %%PLACEHOLDER%%
17
17
18
18
RUN set -ex \
19
19
&& apk add --no-cache --virtual .fetch-deps \
20
20
gnupg \
21
+ libressl \
21
22
tar \
22
23
xz \
23
24
\
@@ -41,6 +42,7 @@ RUN set -ex \
41
42
gdbm-dev \
42
43
libc-dev \
43
44
libnsl-dev \
45
+ libressl \
44
46
libressl-dev \
45
47
libtirpc-dev \
46
48
linux-headers \
@@ -89,9 +91,13 @@ RUN set -ex \
89
91
ENV PYTHON_PIP_VERSION %%PLACEHOLDER%%
90
92
91
93
RUN set -ex; \
94
+ \
95
+ apk add --no-cache --virtual .fetch-deps libressl; \
92
96
\
93
97
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
94
98
\
99
+ apk del .fetch-deps; \
100
+ \
95
101
python get-pip.py \
96
102
--disable-pip-version-check \
97
103
--no-cache-dir \
Original file line number Diff line number Diff line change @@ -152,12 +152,17 @@ for version in "${versions[@]}"; do
152
152
wheezy) sed -ri -e ' s/dpkg-architecture --query /dpkg-architecture -q/g' " $dir /Dockerfile" ;;
153
153
esac
154
154
155
+ if [[ " $v " == alpine* ]] && [ " $v " != ' alpine3.6' ]; then
156
+ # https://github.com/docker-library/python/pull/307
157
+ # on Alpine 3.6 it's necessary to install libressl to get working HTTPS with wget (and ca-certificates for Python's runtime), but later versions don't require this (support for both is baked into the base)
158
+ sed -ri -e ' /(libressl|openssl|ca-certificates)([ ;]|$)/d' " $dir /Dockerfile"
159
+
160
+ # remove any double-empty (or double-empty-continuation) lines the above created
161
+ uniq " $dir /Dockerfile" > " $dir /Dockerfile.new"
162
+ mv " $dir /Dockerfile.new" " $dir /Dockerfile"
163
+ fi
164
+
155
165
case " $version /$v " in
156
- # On Alpine 3.6 it's necessary to install libressl to get working HTTPS.
157
- # Later Alpine versions have CA certificates pre-installed.
158
- * /alpine3.6)
159
- sed -ri -e ' /^# .* libressl$/s/^# //' " $dir /Dockerfile"
160
- ;;& # (other patches needed for Alpine 3.6 in later blocks)
161
166
# https://bugs.python.org/issue32598 (Python 3.7.0b1+)
162
167
# TL;DR: Python 3.7+ uses OpenSSL functionality which LibreSSL 2.6.x in Alpine 3.7 doesn't implement
163
168
# Python 3.5 on Alpine 3.8 needs OpenSSL too
You can’t perform that action at this time.
0 commit comments