Skip to content

Commit 6076ae6

Browse files
committed
Install ca-certificates on Alpine 3.7+ again
1 parent 2bfff51 commit 6076ae6

File tree

15 files changed

+52
-5
lines changed

15 files changed

+52
-5
lines changed

2.7/alpine3.6/Dockerfile

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

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)
18+
# install ca-certificates so that HTTPS works consistently
19+
# other runtime dependencies for Python are installed later
1920
RUN apk add --no-cache ca-certificates
2021

2122
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF

2.7/alpine3.7/Dockerfile

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

18+
# install ca-certificates so that HTTPS works consistently
19+
# other runtime dependencies for Python are installed later
20+
RUN apk add --no-cache ca-certificates
21+
1822
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1923
ENV PYTHON_VERSION 2.7.15
2024

2.7/alpine3.8/Dockerfile

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

18+
# install ca-certificates so that HTTPS works consistently
19+
# other runtime dependencies for Python are installed later
20+
RUN apk add --no-cache ca-certificates
21+
1822
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
1923
ENV PYTHON_VERSION 2.7.15
2024

3.4/alpine3.7/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
1721
ENV PYTHON_VERSION 3.4.8
1822

3.4/alpine3.8/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
1721
ENV PYTHON_VERSION 3.4.8
1822

3.5/alpine3.7/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
1721
ENV PYTHON_VERSION 3.5.5
1822

3.5/alpine3.8/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
1721
ENV PYTHON_VERSION 3.5.5
1822

3.6/alpine3.6/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ 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 (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
16+
# install ca-certificates so that HTTPS works consistently
17+
# other runtime dependencies for Python are installed later
1718
RUN apk add --no-cache ca-certificates
1819

1920
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D

3.6/alpine3.7/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
1721
ENV PYTHON_VERSION 3.6.6
1822

3.6/alpine3.8/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
1721
ENV PYTHON_VERSION 3.6.6
1822

3.7/alpine3.7/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
1721
ENV PYTHON_VERSION 3.7.0
1822

3.7/alpine3.8/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ 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+
# other runtime dependencies for Python are installed later
18+
RUN apk add --no-cache ca-certificates
19+
1620
ENV GPG_KEY 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
1721
ENV PYTHON_VERSION 3.7.0
1822

Dockerfile-alpine.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ENV PATH /usr/local/bin:$PATH
77
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
88
ENV LANG C.UTF-8
99

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)
10+
# install ca-certificates so that HTTPS works consistently
11+
# other runtime dependencies for Python are installed later
1112
RUN apk add --no-cache ca-certificates
1213

1314
ENV GPG_KEY %%PLACEHOLDER%%

Dockerfile-caveman-alpine.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ 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 (other runtime dependencies for Python are installed later); only needed on Alpine 3.6 (3.7+ includes these in the base)
12+
# install ca-certificates so that HTTPS works consistently
13+
# other runtime dependencies for Python are installed later
1314
RUN apk add --no-cache ca-certificates
1415

1516
ENV GPG_KEY %%PLACEHOLDER%%

update.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ for version in "${versions[@]}"; do
155155
if [[ "$v" == alpine* ]] && [ "$v" != 'alpine3.6' ]; then
156156
# https://github.com/docker-library/python/pull/307
157157
# 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"
158+
# https://github.com/docker-library/python/issues/324
159+
# while Alpine 3.7+ includes CA certs in the base (/etc/ssl/cert.pem) and this is sufficient for working HTTPS in wget and Python, some software (notably, any Golang code) expects CA certs at /etc/ssl/certs/
160+
# this means it is still necessary to install ca-certificates in all Alpine images for consistently working HTTPS
161+
sed -ri -e '/(libressl|openssl)([ ;]|$)/d' "$dir/Dockerfile"
159162

160163
# remove any double-empty (or double-empty-continuation) lines the above created
161164
uniq "$dir/Dockerfile" > "$dir/Dockerfile.new"

0 commit comments

Comments
 (0)