Skip to content

Instantly share code, notes, and snippets.

@pcgeek86
Created Oct 27, 2017
Embed
What would you like to do?
Install Python 3.6 and Boto3 package on Windows Server container
$Tag = 'winpython:3.6.3'
docker build --no-cache --tag $Tag $PSScriptRoot
FROM microsoft/windowsservercore
MAINTAINER Trevor Sullivan <tsulli@amazon.com>
SHELL ["powershell", "-Command"]
ENV PYTHON_DOWNLOAD https://www.python.org/ftp/python/3.6.3/python-3.6.3-amd64.exe
ENV PYTHON_FILE python-3.6.3-amd64.exe
COPY Install-Boto3.py c:/Amazon/
RUN [System.Net.WebClient]::new().DownloadFile($env:PYTHON_DOWNLOAD, ('c:\Amazon\{0}' -f $env:PYTHON_FILE)); \
Set-Location -Path c:\Amazon\; \
Start-Process -Wait -FilePath $env:PYTHON_FILE -ArgumentList '/passive /log python.log'; \
Start-Process -Wait -FilePath py -ArgumentList 'c:/Amazon/Install-Boto3.py';
ENTRYPOINT ["powershell"]
import pip
pip.main(['install', 'boto3'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment