Skip to content

Commit d9536f1

Browse files
committed
Adjust implementation for smaller diff from existing (keeping "ca-certificates" installed and removing "libressl" after downloading)
1 parent 93c1436 commit d9536f1

File tree

15 files changed

+62
-43
lines changed

15 files changed

+62
-43
lines changed

2.7/alpine3.6/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ ENV LANG C.UTF-8
1515
# https://github.com/docker-library/python/issues/147
1616
ENV PYTHONIOENCODING UTF-8
1717

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
2020

2121
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
2222
ENV PYTHON_VERSION 2.7.15
2323

2424
RUN set -ex \
2525
&& apk add --no-cache --virtual .fetch-deps \
2626
gnupg \
27+
libressl \
2728
tar \
2829
xz \
2930
\
@@ -46,6 +47,7 @@ RUN set -ex \
4647
gcc \
4748
gdbm-dev \
4849
libc-dev \
50+
libressl \
4951
libressl-dev \
5052
linux-headers \
5153
make \
@@ -93,9 +95,13 @@ RUN set -ex \
9395
ENV PYTHON_PIP_VERSION 18.0
9496

9597
RUN set -ex; \
98+
\
99+
apk add --no-cache --virtual .fetch-deps libressl; \
96100
\
97101
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
98102
\
103+
apk del .fetch-deps; \
104+
\
99105
python get-pip.py \
100106
--disable-pip-version-check \
101107
--no-cache-dir \

2.7/alpine3.7/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ ENV LANG C.UTF-8
1515
# https://github.com/docker-library/python/issues/147
1616
ENV PYTHONIOENCODING UTF-8
1717

18-
# install libressl so that HTTPS works on Alpine <3.7
19-
# RUN apk add --no-cache libressl
20-
2118
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
2219
ENV PYTHON_VERSION 2.7.15
2320

@@ -98,6 +95,8 @@ RUN set -ex; \
9895
\
9996
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
10097
\
98+
apk del .fetch-deps; \
99+
\
101100
python get-pip.py \
102101
--disable-pip-version-check \
103102
--no-cache-dir \

2.7/alpine3.8/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ ENV LANG C.UTF-8
1515
# https://github.com/docker-library/python/issues/147
1616
ENV PYTHONIOENCODING UTF-8
1717

18-
# install libressl so that HTTPS works on Alpine <3.7
19-
# RUN apk add --no-cache libressl
20-
2118
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
2219
ENV PYTHON_VERSION 2.7.15
2320

@@ -98,6 +95,8 @@ RUN set -ex; \
9895
\
9996
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
10097
\
98+
apk del .fetch-deps; \
99+
\
101100
python get-pip.py \
102101
--disable-pip-version-check \
103102
--no-cache-dir \

3.4/alpine3.7/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2017
ENV PYTHON_VERSION 3.4.8
2118

@@ -107,6 +104,8 @@ RUN set -ex; \
107104
\
108105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109106
\
107+
apk del .fetch-deps; \
108+
\
110109
python get-pip.py \
111110
--disable-pip-version-check \
112111
--no-cache-dir \

3.4/alpine3.8/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2017
ENV PYTHON_VERSION 3.4.8
2118

@@ -107,6 +104,8 @@ RUN set -ex; \
107104
\
108105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109106
\
107+
apk del .fetch-deps; \
108+
\
110109
python get-pip.py \
111110
--disable-pip-version-check \
112111
--no-cache-dir \

3.5/alpine3.7/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2017
ENV PYTHON_VERSION 3.5.5
2118

@@ -107,6 +104,8 @@ RUN set -ex; \
107104
\
108105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109106
\
107+
apk del .fetch-deps; \
108+
\
110109
python get-pip.py \
111110
--disable-pip-version-check \
112111
--no-cache-dir \

3.5/alpine3.8/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
2017
ENV PYTHON_VERSION 3.5.5
2118

@@ -107,6 +104,8 @@ RUN set -ex; \
107104
\
108105
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109106
\
107+
apk del .fetch-deps; \
108+
\
110109
python get-pip.py \
111110
--disable-pip-version-check \
112111
--no-cache-dir \

3.6/alpine3.6/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ 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 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
1818

1919
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2020
ENV PYTHON_VERSION 3.6.6
2121

2222
RUN set -ex \
2323
&& apk add --no-cache --virtual .fetch-deps \
2424
gnupg \
25+
libressl \
2526
tar \
2627
xz \
2728
\
@@ -46,6 +47,7 @@ RUN set -ex \
4647
gdbm-dev \
4748
libc-dev \
4849
libffi-dev \
50+
libressl \
4951
libressl-dev \
5052
linux-headers \
5153
make \
@@ -104,9 +106,13 @@ RUN cd /usr/local/bin \
104106
ENV PYTHON_PIP_VERSION 18.0
105107

106108
RUN set -ex; \
109+
\
110+
apk add --no-cache --virtual .fetch-deps libressl; \
107111
\
108112
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
109113
\
114+
apk del .fetch-deps; \
115+
\
110116
python get-pip.py \
111117
--disable-pip-version-check \
112118
--no-cache-dir \

3.6/alpine3.7/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2017
ENV PYTHON_VERSION 3.6.6
2118

@@ -109,6 +106,8 @@ RUN set -ex; \
109106
\
110107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
111108
\
109+
apk del .fetch-deps; \
110+
\
112111
python get-pip.py \
113112
--disable-pip-version-check \
114113
--no-cache-dir \

3.6/alpine3.8/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ 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 libressl so that HTTPS works on Alpine <3.7
17-
# RUN apk add --no-cache libressl
18-
1916
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
2017
ENV PYTHON_VERSION 3.6.6
2118

@@ -109,6 +106,8 @@ RUN set -ex; \
109106
\
110107
wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \
111108
\
109+
apk del .fetch-deps; \
110+
\
112111
python get-pip.py \
113112
--disable-pip-version-check \
114113
--no-cache-dir \

0 commit comments

Comments
 (0)