diff --git a/2.7/alpine3.10/Dockerfile b/2.7/alpine3.10/Dockerfile index 624b37c0a..c8b106d19 100644 --- a/2.7/alpine3.10/Dockerfile +++ b/2.7/alpine3.10/Dockerfile @@ -97,11 +97,15 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/2.7/alpine3.9/Dockerfile b/2.7/alpine3.9/Dockerfile index 552549ad0..548bc8198 100644 --- a/2.7/alpine3.9/Dockerfile +++ b/2.7/alpine3.9/Dockerfile @@ -97,11 +97,15 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/2.7/buster/Dockerfile b/2.7/buster/Dockerfile index e693c6e8b..e25a706a2 100644 --- a/2.7/buster/Dockerfile +++ b/2.7/buster/Dockerfile @@ -57,11 +57,15 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/2.7/buster/slim/Dockerfile b/2.7/buster/slim/Dockerfile index e08d2a90d..dcd412d2a 100644 --- a/2.7/buster/slim/Dockerfile +++ b/2.7/buster/slim/Dockerfile @@ -90,7 +90,10 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -98,7 +101,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/2.7/stretch/Dockerfile b/2.7/stretch/Dockerfile index 3da1e5be2..347a654cd 100644 --- a/2.7/stretch/Dockerfile +++ b/2.7/stretch/Dockerfile @@ -57,11 +57,15 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/2.7/stretch/slim/Dockerfile b/2.7/stretch/slim/Dockerfile index 1ef536c22..53990823f 100644 --- a/2.7/stretch/slim/Dockerfile +++ b/2.7/stretch/slim/Dockerfile @@ -90,7 +90,10 @@ RUN set -ex \ && python2 --version # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -98,7 +101,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/2.7/windows/windowsservercore-1803/Dockerfile b/2.7/windows/windowsservercore-1803/Dockerfile index 7bf50d0e6..b82f36f1f 100644 --- a/2.7/windows/windowsservercore-1803/Dockerfile +++ b/2.7/windows/windowsservercore-1803/Dockerfile @@ -38,14 +38,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env Write-Host 'Removing ...'; \ Remove-Item python.msi -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -56,7 +66,7 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/2.7/windows/windowsservercore-1809/Dockerfile b/2.7/windows/windowsservercore-1809/Dockerfile index a288f727b..cf6e7ebe6 100644 --- a/2.7/windows/windowsservercore-1809/Dockerfile +++ b/2.7/windows/windowsservercore-1809/Dockerfile @@ -38,14 +38,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env Write-Host 'Removing ...'; \ Remove-Item python.msi -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -56,7 +66,7 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/2.7/windows/windowsservercore-ltsc2016/Dockerfile b/2.7/windows/windowsservercore-ltsc2016/Dockerfile index bc480ee23..9b7a22644 100644 --- a/2.7/windows/windowsservercore-ltsc2016/Dockerfile +++ b/2.7/windows/windowsservercore-ltsc2016/Dockerfile @@ -38,14 +38,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env Write-Host 'Removing ...'; \ Remove-Item python.msi -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -56,7 +66,7 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/3.5/alpine3.10/Dockerfile b/3.5/alpine3.10/Dockerfile index 7fdc6416c..a4132be9f 100644 --- a/3.5/alpine3.10/Dockerfile +++ b/3.5/alpine3.10/Dockerfile @@ -139,11 +139,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.5/alpine3.9/Dockerfile b/3.5/alpine3.9/Dockerfile index da9c8dde5..31cc02d79 100644 --- a/3.5/alpine3.9/Dockerfile +++ b/3.5/alpine3.9/Dockerfile @@ -139,11 +139,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.5/buster/Dockerfile b/3.5/buster/Dockerfile index b692e2657..d0c5b8837 100644 --- a/3.5/buster/Dockerfile +++ b/3.5/buster/Dockerfile @@ -102,11 +102,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.5/buster/slim/Dockerfile b/3.5/buster/slim/Dockerfile index d5d818d80..07cf9831e 100644 --- a/3.5/buster/slim/Dockerfile +++ b/3.5/buster/slim/Dockerfile @@ -137,7 +137,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -145,7 +148,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.5/stretch/Dockerfile b/3.5/stretch/Dockerfile index 108c5b0d9..f499671de 100644 --- a/3.5/stretch/Dockerfile +++ b/3.5/stretch/Dockerfile @@ -102,11 +102,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.5/stretch/slim/Dockerfile b/3.5/stretch/slim/Dockerfile index d916a1a9c..307a54a74 100644 --- a/3.5/stretch/slim/Dockerfile +++ b/3.5/stretch/slim/Dockerfile @@ -137,7 +137,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -145,7 +148,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.6/alpine3.10/Dockerfile b/3.6/alpine3.10/Dockerfile index 11ee62ab3..53348e814 100644 --- a/3.6/alpine3.10/Dockerfile +++ b/3.6/alpine3.10/Dockerfile @@ -141,11 +141,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.6/alpine3.9/Dockerfile b/3.6/alpine3.9/Dockerfile index edb8f1996..44b97df25 100644 --- a/3.6/alpine3.9/Dockerfile +++ b/3.6/alpine3.9/Dockerfile @@ -141,11 +141,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.6/buster/Dockerfile b/3.6/buster/Dockerfile index b56f1a3f5..af1540aba 100644 --- a/3.6/buster/Dockerfile +++ b/3.6/buster/Dockerfile @@ -102,11 +102,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.6/buster/slim/Dockerfile b/3.6/buster/slim/Dockerfile index a01bcdcf6..24a8b81a6 100644 --- a/3.6/buster/slim/Dockerfile +++ b/3.6/buster/slim/Dockerfile @@ -137,7 +137,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -145,7 +148,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.6/stretch/Dockerfile b/3.6/stretch/Dockerfile index b4eaf7c68..d5aaff5a0 100644 --- a/3.6/stretch/Dockerfile +++ b/3.6/stretch/Dockerfile @@ -102,11 +102,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.6/stretch/slim/Dockerfile b/3.6/stretch/slim/Dockerfile index 999313bce..3527c8967 100644 --- a/3.6/stretch/slim/Dockerfile +++ b/3.6/stretch/slim/Dockerfile @@ -137,7 +137,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -145,7 +148,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.7/alpine3.10/Dockerfile b/3.7/alpine3.10/Dockerfile index ea730da36..a4f779221 100644 --- a/3.7/alpine3.10/Dockerfile +++ b/3.7/alpine3.10/Dockerfile @@ -142,11 +142,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.7/alpine3.9/Dockerfile b/3.7/alpine3.9/Dockerfile index f4177c170..c262944f0 100644 --- a/3.7/alpine3.9/Dockerfile +++ b/3.7/alpine3.9/Dockerfile @@ -142,11 +142,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index bb5bd0bd1..341213a6b 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -103,11 +103,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.7/buster/slim/Dockerfile b/3.7/buster/slim/Dockerfile index 9cf0c19a6..a58b2e6a3 100644 --- a/3.7/buster/slim/Dockerfile +++ b/3.7/buster/slim/Dockerfile @@ -138,7 +138,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -146,7 +149,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.7/stretch/Dockerfile b/3.7/stretch/Dockerfile index 72dcaa16c..2f0ad9e33 100644 --- a/3.7/stretch/Dockerfile +++ b/3.7/stretch/Dockerfile @@ -103,11 +103,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.7/stretch/slim/Dockerfile b/3.7/stretch/slim/Dockerfile index d4822244a..b5d7f3b6d 100644 --- a/3.7/stretch/slim/Dockerfile +++ b/3.7/stretch/slim/Dockerfile @@ -138,7 +138,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -146,7 +149,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.7/windows/windowsservercore-1803/Dockerfile b/3.7/windows/windowsservercore-1803/Dockerfile index 9c665e24f..cdb8dd66d 100644 --- a/3.7/windows/windowsservercore-1803/Dockerfile +++ b/3.7/windows/windowsservercore-1803/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/3.7/windows/windowsservercore-1809/Dockerfile b/3.7/windows/windowsservercore-1809/Dockerfile index 84920384b..293658a21 100644 --- a/3.7/windows/windowsservercore-1809/Dockerfile +++ b/3.7/windows/windowsservercore-1809/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/3.7/windows/windowsservercore-ltsc2016/Dockerfile b/3.7/windows/windowsservercore-ltsc2016/Dockerfile index 79257e930..a39ecaa48 100644 --- a/3.7/windows/windowsservercore-ltsc2016/Dockerfile +++ b/3.7/windows/windowsservercore-ltsc2016/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/3.8-rc/alpine3.10/Dockerfile b/3.8-rc/alpine3.10/Dockerfile index 65cb54c59..ee0f82fa8 100644 --- a/3.8-rc/alpine3.10/Dockerfile +++ b/3.8-rc/alpine3.10/Dockerfile @@ -142,11 +142,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.8-rc/buster/Dockerfile b/3.8-rc/buster/Dockerfile index 5d61f691c..3509d242f 100644 --- a/3.8-rc/buster/Dockerfile +++ b/3.8-rc/buster/Dockerfile @@ -103,11 +103,15 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/3.8-rc/buster/slim/Dockerfile b/3.8-rc/buster/slim/Dockerfile index ad4ee048a..3e56b66ee 100644 --- a/3.8-rc/buster/slim/Dockerfile +++ b/3.8-rc/buster/slim/Dockerfile @@ -138,7 +138,10 @@ RUN cd /usr/local/bin \ && ln -s python3-config python-config # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d RUN set -ex; \ \ @@ -146,7 +149,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/3.8-rc/windows/windowsservercore-1803/Dockerfile b/3.8-rc/windows/windowsservercore-1803/Dockerfile index 0c10a3f72..822ad7698 100644 --- a/3.8-rc/windows/windowsservercore-1803/Dockerfile +++ b/3.8-rc/windows/windowsservercore-1803/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/3.8-rc/windows/windowsservercore-1809/Dockerfile b/3.8-rc/windows/windowsservercore-1809/Dockerfile index 9302ce913..649c8001a 100644 --- a/3.8-rc/windows/windowsservercore-1809/Dockerfile +++ b/3.8-rc/windows/windowsservercore-1809/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/3.8-rc/windows/windowsservercore-ltsc2016/Dockerfile b/3.8-rc/windows/windowsservercore-ltsc2016/Dockerfile index 669e060ea..1301d238f 100644 --- a/3.8-rc/windows/windowsservercore-ltsc2016/Dockerfile +++ b/3.8-rc/windows/windowsservercore-ltsc2016/Dockerfile @@ -39,14 +39,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION 19.1.1 +ENV PYTHON_PIP_VERSION 19.2.1 +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py +ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -57,6 +67,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 7addeba00..4ad0db0e9 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -137,10 +137,14 @@ RUN cd /usr/local/bin \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/Dockerfile-caveman-alpine.template b/Dockerfile-caveman-alpine.template index 8af172f5e..d784e2f14 100644 --- a/Dockerfile-caveman-alpine.template +++ b/Dockerfile-caveman-alpine.template @@ -92,10 +92,14 @@ RUN set -ex \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum -c -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/Dockerfile-caveman-debian.template b/Dockerfile-caveman-debian.template index a38778791..df33f7fad 100644 --- a/Dockerfile-caveman-debian.template +++ b/Dockerfile-caveman-debian.template @@ -52,10 +52,14 @@ RUN set -ex \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/Dockerfile-caveman-slim.template b/Dockerfile-caveman-slim.template index 8a96f06d7..064e5ec9e 100644 --- a/Dockerfile-caveman-slim.template +++ b/Dockerfile-caveman-slim.template @@ -85,6 +85,9 @@ RUN set -ex \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ @@ -92,7 +95,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/Dockerfile-caveman-windowsservercore.template b/Dockerfile-caveman-windowsservercore.template index f0fe4e606..1185973c9 100644 --- a/Dockerfile-caveman-windowsservercore.template +++ b/Dockerfile-caveman-windowsservercore.template @@ -32,14 +32,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env Write-Host 'Removing ...'; \ Remove-Item python.msi -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -50,7 +60,7 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # install "virtualenv", since the vast majority of users of this image will want it RUN pip install --no-cache-dir virtualenv diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index eae30d77d..b07f4ceb2 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -100,10 +100,14 @@ RUN cd /usr/local/bin \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ python get-pip.py \ --disable-pip-version-check \ diff --git a/Dockerfile-slim.template b/Dockerfile-slim.template index 3dda6108a..1413e34a9 100644 --- a/Dockerfile-slim.template +++ b/Dockerfile-slim.template @@ -133,6 +133,9 @@ RUN cd /usr/local/bin \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% RUN set -ex; \ \ @@ -140,7 +143,8 @@ RUN set -ex; \ apt-get update; \ apt-get install -y --no-install-recommends wget; \ \ - wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py'; \ + wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \ + echo "$PYTHON_GET_PIP_SHA256 *get-pip.py" | sha256sum --check --strict -; \ \ apt-mark auto '.*' > /dev/null; \ [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \ diff --git a/Dockerfile-windowsservercore.template b/Dockerfile-windowsservercore.template index 57b59c266..d5ded28fb 100644 --- a/Dockerfile-windowsservercore.template +++ b/Dockerfile-windowsservercore.template @@ -33,14 +33,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f $env Write-Host 'Removing ...'; \ Remove-Item python.exe -Force; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION %%PLACEHOLDER%% +# https://github.com/pypa/get-pip +ENV PYTHON_GET_PIP_URL %%PLACEHOLDER%% +ENV PYTHON_GET_PIP_SHA256 %%PLACEHOLDER%% -RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ +RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ - Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ + Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \ + if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ python get-pip.py \ --disable-pip-version-check \ --no-cache-dir \ @@ -51,6 +61,6 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ Write-Host 'Verifying pip install ...'; \ pip --version; \ \ - Write-Host 'Complete.'; + Write-Host 'Complete.' CMD ["python"] diff --git a/update.sh b/update.sh index 5678a5b68..71fc8ba1f 100755 --- a/update.sh +++ b/update.sh @@ -34,6 +34,9 @@ fi versions=( "${versions[@]%/}" ) pipVersion="$(curl -fsSL 'https://pypi.org/pypi/pip/json' | jq -r .info.version)" +getPipCommit="$(curl -fsSL 'https://github.com/pypa/get-pip/commits/master/get-pip.py.atom' | tac|tac | awk -F '[[:space:]]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')" +getPipUrl="https://github.com/pypa/get-pip/raw/$getPipCommit/get-pip.py" +getPipSha256="$(curl -fsSL "$getPipUrl" | sha256sum | cut -d' ' -f1)" generated_warning() { cat <<-EOH @@ -144,6 +147,8 @@ for version in "${versions[@]}"; do -e 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' \ -e 's/^(ENV PYTHON_RELEASE) .*/\1 '"${fullVersion%%[a-z]*}"'/' \ -e 's/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/' \ + -e 's!^(ENV PYTHON_GET_PIP_URL) .*!\1 '"$getPipUrl"'!' \ + -e 's!^(ENV PYTHON_GET_PIP_SHA256) .*!\1 '"$getPipSha256"'!' \ -e 's/^(FROM python):.*/\1:'"$version-$tag"'/' \ -e 's!^(FROM (debian|buildpack-deps|alpine|mcr[.]microsoft[.]com/[^:]+)):.*!\1:'"$tag"'!' \ "$dir/Dockerfile"