@@ -38,14 +38,24 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env
3838 Write-Host 'Removing ...' ; \
3939 Remove-Item python.msi -Force; \
4040 \
41- Write-Host 'Complete.' ;
41+ Write-Host 'Complete.'
4242
4343# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
44- ENV PYTHON_PIP_VERSION 19.1.1
44+ ENV PYTHON_PIP_VERSION 19.2.1
45+ # https://github.com/pypa/get-pip
46+ ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/404c9418e33c5031b1a9ab623168b3e8a2ed8c88/get-pip.py
47+ ENV PYTHON_GET_PIP_SHA256 56bb63d3cf54e7444351256f72a60f575f6d8c7f1faacffae33167afc8e7609d
4548
46- RUN Write-Host ('Installing pip== {0} ...' -f $env:PYTHON_PIP_VERSION ); \
49+ RUN Write-Host ('Downloading get- pip.py ( {0}) ...' -f $env:PYTHON_GET_PIP_URL ); \
4750 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
48- Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py' ; \
51+ Invoke-WebRequest -Uri $env:PYTHON_GET_PIP_URL -OutFile 'get-pip.py' ; \
52+ Write-Host ('Verifying sha256 ({0}) ...' -f $env:PYTHON_GET_PIP_SHA256); \
53+ if ((Get-FileHash 'get-pip.py' -Algorithm sha256).Hash -ne $env:PYTHON_GET_PIP_SHA256) { \
54+ Write-Host 'FAILED!' ; \
55+ exit 1; \
56+ }; \
57+ \
58+ Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
4959 python get-pip.py \
5060 --disable-pip-version-check \
5161 --no-cache-dir \
@@ -56,7 +66,7 @@ RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \
5666 Write-Host 'Verifying pip install ...' ; \
5767 pip --version; \
5868 \
59- Write-Host 'Complete.' ;
69+ Write-Host 'Complete.'
6070
6171# install "virtualenv", since the vast majority of users of this image will want it
6272RUN pip install --no-cache-dir virtualenv
0 commit comments