|
| 1 | +# |
| 2 | +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" |
| 3 | +# |
| 4 | +# PLEASE DO NOT EDIT IT DIRECTLY. |
| 5 | +# |
| 6 | + |
| 7 | +FROM mcr.microsoft.com/windows/servercore:1803 |
| 8 | + |
| 9 | +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] |
| 10 | + |
| 11 | +ENV PYTHON_VERSION 2.7.15 |
| 12 | +ENV PYTHON_RELEASE 2.7.15 |
| 13 | + |
| 14 | +RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}.amd64.msi' -f $env:PYTHON_RELEASE, $env:PYTHON_VERSION); \ |
| 15 | + Write-Host ('Downloading {0} ...' -f $url); \ |
| 16 | + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ |
| 17 | + Invoke-WebRequest -Uri $url -OutFile 'python.msi'; \ |
| 18 | + \ |
| 19 | + Write-Host 'Installing ...'; \ |
| 20 | +# https://www.python.org/download/releases/2.4/msi/ |
| 21 | + Start-Process msiexec -Wait \ |
| 22 | + -ArgumentList @( \ |
| 23 | + '/i', \ |
| 24 | + 'python.msi', \ |
| 25 | + '/quiet', \ |
| 26 | + '/qn', \ |
| 27 | + 'TARGETDIR=C:\Python', \ |
| 28 | + 'ALLUSERS=1', \ |
| 29 | + 'ADDLOCAL=DefaultFeature,Extensions,TclTk,Tools,PrependPath' \ |
| 30 | + ); \ |
| 31 | + \ |
| 32 | +# the installer updated PATH, so we should refresh our local value |
| 33 | + $env:PATH = [Environment]::GetEnvironmentVariable('PATH', [EnvironmentVariableTarget]::Machine); \ |
| 34 | + \ |
| 35 | + Write-Host 'Verifying install ...'; \ |
| 36 | + Write-Host ' python --version'; python --version; \ |
| 37 | + \ |
| 38 | + Write-Host 'Removing ...'; \ |
| 39 | + Remove-Item python.msi -Force; \ |
| 40 | + \ |
| 41 | + Write-Host 'Complete.'; |
| 42 | + |
| 43 | +# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" |
| 44 | +ENV PYTHON_PIP_VERSION 19.0.2 |
| 45 | + |
| 46 | +RUN Write-Host ('Installing pip=={0} ...' -f $env:PYTHON_PIP_VERSION); \ |
| 47 | + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ |
| 48 | + Invoke-WebRequest -Uri 'https://bootstrap.pypa.io/get-pip.py' -OutFile 'get-pip.py'; \ |
| 49 | + python get-pip.py \ |
| 50 | + --disable-pip-version-check \ |
| 51 | + --no-cache-dir \ |
| 52 | + ('pip=={0}' -f $env:PYTHON_PIP_VERSION) \ |
| 53 | + ; \ |
| 54 | + Remove-Item get-pip.py -Force; \ |
| 55 | + \ |
| 56 | + Write-Host 'Verifying pip install ...'; \ |
| 57 | + pip --version; \ |
| 58 | + \ |
| 59 | + Write-Host 'Complete.'; |
| 60 | + |
| 61 | +# install "virtualenv", since the vast majority of users of this image will want it |
| 62 | +RUN pip install --no-cache-dir virtualenv |
| 63 | + |
| 64 | +CMD ["python"] |
0 commit comments