Skip to content

Commit 92f99db

Browse files
committed
alpine: Don't install ca-certificates on Alpine 3.7+
* CA certs come bundled on Alpine 3.7+ * On Alpine 3.6, rather install libressl which also include CA certs, allows us to use wget, and doesn't increase the size over ca-certificates
1 parent ea4449a commit 92f99db

File tree

14 files changed

+32
-116
lines changed

14 files changed

+32
-116
lines changed

2.7/alpine3.6/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ ENV LANG C.UTF-8
99
# https://github.com/docker-library/python/issues/147
1010
ENV PYTHONIOENCODING UTF-8
1111

12-
# install ca-certificates so that HTTPS works consistently
13-
# the other runtime dependencies for Python are installed later
14-
RUN apk add --no-cache ca-certificates
12+
# install libressl so that HTTPS works on Alpine <3.7
13+
RUN apk add --no-cache libressl
1514

1615
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1716
ENV PYTHON_VERSION 2.7.15
1817

1918
RUN set -ex \
2019
&& apk add --no-cache --virtual .fetch-deps \
2120
gnupg \
22-
libressl \
2321
tar \
2422
xz \
2523
\
@@ -41,7 +39,6 @@ RUN set -ex \
4139
gcc \
4240
gdbm-dev \
4341
libc-dev \
44-
libressl \
4542
libressl-dev \
4643
linux-headers \
4744
make \
@@ -89,13 +86,9 @@ RUN set -ex \
8986
ENV PYTHON_PIP_VERSION 10.0.1
9087

9188
RUN set -ex; \
92-
\
93-
apk add --no-cache --virtual .fetch-deps libressl; \
9489
\
9590
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
9691
\
97-
apk del .fetch-deps; \
98-
\
9992
python get-pip.py \
10093
--disable-pip-version-check \
10194
--no-cache-dir \

2.7/alpine3.7/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ ENV LANG C.UTF-8
99
# https://github.com/docker-library/python/issues/147
1010
ENV PYTHONIOENCODING UTF-8
1111

12-
# install ca-certificates so that HTTPS works consistently
13-
# the other runtime dependencies for Python are installed later
14-
RUN apk add --no-cache ca-certificates
12+
# install libressl so that HTTPS works on Alpine <3.7
13+
# RUN apk add --no-cache libressl
1514

1615
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1716
ENV PYTHON_VERSION 2.7.15
1817

1918
RUN set -ex \
2019
&& apk add --no-cache --virtual .fetch-deps \
2120
gnupg \
22-
libressl \
2321
tar \
2422
xz \
2523
\
@@ -91,13 +89,9 @@ RUN set -ex \
9189
ENV PYTHON_PIP_VERSION 10.0.1
9290

9391
RUN set -ex; \
94-
\
95-
apk add --no-cache --virtual .fetch-deps libressl; \
9692
\
9793
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
9894
\
99-
apk del .fetch-deps; \
100-
\
10195
python get-pip.py \
10296
--disable-pip-version-check \
10397
--no-cache-dir \

2.7/alpine3.8/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ ENV LANG C.UTF-8
99
# https://github.com/docker-library/python/issues/147
1010
ENV PYTHONIOENCODING UTF-8
1111

12-
# install ca-certificates so that HTTPS works consistently
13-
# the other runtime dependencies for Python are installed later
14-
RUN apk add --no-cache ca-certificates
12+
# install libressl so that HTTPS works on Alpine <3.7
13+
# RUN apk add --no-cache libressl
1514

1615
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1716
ENV PYTHON_VERSION 2.7.15
1817

1918
RUN set -ex \
2019
&& apk add --no-cache --virtual .fetch-deps \
2120
gnupg \
22-
libressl \
2321
tar \
2422
xz \
2523
\
@@ -91,13 +89,9 @@ RUN set -ex \
9189
ENV PYTHON_PIP_VERSION 10.0.1
9290

9391
RUN set -ex; \
94-
\
95-
apk add --no-cache --virtual .fetch-deps libressl; \
9692
\
9793
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
9894
\
99-
apk del .fetch-deps; \
100-
\
10195
python get-pip.py \
10296
--disable-pip-version-check \
10397
--no-cache-dir \

3.4/alpine3.7/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
# RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2120
ENV PYTHON_VERSION 3.4.8
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
libressl \
2725
tar \
2826
xz \
2927
\
@@ -48,7 +46,6 @@ RUN set -ex \
4846
gdbm-dev \
4947
libc-dev \
5048
libffi-dev \
51-
libressl \
5249
libressl-dev \
5350
linux-headers \
5451
make \
@@ -107,13 +104,9 @@ RUN cd /usr/local/bin \
107104
ENV PYTHON_PIP_VERSION 10.0.1
108105

109106
RUN set -ex; \
110-
\
111-
apk add --no-cache --virtual .fetch-deps libressl; \
112107
\
113108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
114109
\
115-
apk del .fetch-deps; \
116-
\
117110
python get-pip.py \
118111
--disable-pip-version-check \
119112
--no-cache-dir \

3.4/alpine3.8/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
# RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2120
ENV PYTHON_VERSION 3.4.8
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
libressl \
2725
tar \
2826
xz \
2927
\
@@ -48,7 +46,6 @@ RUN set -ex \
4846
gdbm-dev \
4947
libc-dev \
5048
libffi-dev \
51-
libressl \
5249
libressl-dev \
5350
linux-headers \
5451
make \
@@ -107,13 +104,9 @@ RUN cd /usr/local/bin \
107104
ENV PYTHON_PIP_VERSION 10.0.1
108105

109106
RUN set -ex; \
110-
\
111-
apk add --no-cache --virtual .fetch-deps libressl; \
112107
\
113108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
114109
\
115-
apk del .fetch-deps; \
116-
\
117110
python get-pip.py \
118111
--disable-pip-version-check \
119112
--no-cache-dir \

3.5/alpine3.7/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
# RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2120
ENV PYTHON_VERSION 3.5.5
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
libressl \
2725
tar \
2826
xz \
2927
\
@@ -48,7 +46,6 @@ RUN set -ex \
4846
gdbm-dev \
4947
libc-dev \
5048
libffi-dev \
51-
libressl \
5249
libressl-dev \
5350
linux-headers \
5451
make \
@@ -107,13 +104,9 @@ RUN cd /usr/local/bin \
107104
ENV PYTHON_PIP_VERSION 10.0.1
108105

109106
RUN set -ex; \
110-
\
111-
apk add --no-cache --virtual .fetch-deps libressl; \
112107
\
113108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
114109
\
115-
apk del .fetch-deps; \
116-
\
117110
python get-pip.py \
118111
--disable-pip-version-check \
119112
--no-cache-dir \

3.5/alpine3.8/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
# RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2120
ENV PYTHON_VERSION 3.5.5
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
openssl \
2725
tar \
2826
xz \
2927
\
@@ -48,7 +46,6 @@ RUN set -ex \
4846
gdbm-dev \
4947
libc-dev \
5048
libffi-dev \
51-
openssl \
5249
openssl-dev \
5350
linux-headers \
5451
make \
@@ -107,13 +104,9 @@ RUN cd /usr/local/bin \
107104
ENV PYTHON_PIP_VERSION 10.0.1
108105

109106
RUN set -ex; \
110-
\
111-
apk add --no-cache --virtual .fetch-deps openssl; \
112107
\
113108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
114109
\
115-
apk del .fetch-deps; \
116-
\
117110
python get-pip.py \
118111
--disable-pip-version-check \
119112
--no-cache-dir \

3.6/alpine3.6/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2120
ENV PYTHON_VERSION 3.6.6
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
libressl \
2725
tar \
2826
xz \
2927
\
@@ -48,7 +46,6 @@ RUN set -ex \
4846
gdbm-dev \
4947
libc-dev \
5048
libffi-dev \
51-
libressl \
5249
libressl-dev \
5350
linux-headers \
5451
make \
@@ -107,13 +104,9 @@ RUN cd /usr/local/bin \
107104
ENV PYTHON_PIP_VERSION 10.0.1
108105

109106
RUN set -ex; \
110-
\
111-
apk add --no-cache --virtual .fetch-deps libressl; \
112107
\
113108
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
114109
\
115-
apk del .fetch-deps; \
116-
\
117110
python get-pip.py \
118111
--disable-pip-version-check \
119112
--no-cache-dir \

3.6/alpine3.7/Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ ENV PATH /usr/local/bin:$PATH
1313
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
1414
ENV LANG C.UTF-8
1515

16-
# install ca-certificates so that HTTPS works consistently
17-
# the other runtime dependencies for Python are installed later
18-
RUN apk add --no-cache ca-certificates
16+
# install libressl so that HTTPS works on Alpine <3.7
17+
# RUN apk add --no-cache libressl
1918

2019
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2120
ENV PYTHON_VERSION 3.6.6
2221

2322
RUN set -ex \
2423
&& apk add --no-cache --virtual .fetch-deps \
2524
gnupg \
26-
libressl \
2725
tar \
2826
xz \
2927
\
@@ -49,7 +47,6 @@ RUN set -ex \
4947
libc-dev \
5048
libffi-dev \
5149
libnsl-dev \
52-
libressl \
5350
libressl-dev \
5451
libtirpc-dev \
5552
linux-headers \
@@ -109,13 +106,9 @@ RUN cd /usr/local/bin \
109106
ENV PYTHON_PIP_VERSION 10.0.1
110107

111108
RUN set -ex; \
112-
\
113-
apk add --no-cache --virtual .fetch-deps libressl; \
114109
\
115110
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
116111
\
117-
apk del .fetch-deps; \
118-
\
119112
python get-pip.py \
120113
--disable-pip-version-check \
121114
--no-cache-dir \

0 commit comments

Comments
 (0)