Skip to content

Commit

Permalink
Update docker image to include all Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bfloch committed Oct 31, 2019
1 parent a7c37d2 commit ca28dfe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/docker/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ FROM mcr.microsoft.com/windows/servercore:1809-amd64

SHELL ["powershell.exe", "-NoLogo", "-NoProfile", "-ExecutionPolicy", "ByPass"]

# List of Python versions to install (with ; as delimiter)
# For example: 2.7.5;3.7.5
#
ARG PYTHON_VERSIONS

RUN echo ${ENV:PYTHON_VERSIONS}

# ------------------------------------------------------------------------------------------------------------
# Chocolatey
#
Expand All @@ -22,6 +29,15 @@ RUN choco install git.install --yes --version=2.23.0
#
RUN choco install cmake --yes --version=3.15.4 --installargs 'ADD_CMAKE_TO_PATH=System'

# ------------------------------------------------------------------------------------------------------------
# Python
#
RUN (${ENV:PYTHON_VERSIONS}).Split(";") | ForEach-Object { \
${PYTHON_VERSION} = $_ \
${PYTHON_VERSION_CODE} += ( $PYTHON_VERSION.Split(".")[0..1] -Join '' ) \
choco install python --yes --version=${PYTHON_VERSION} --installargs='TargetDir=""C:\python${PYTHON_VERSION_CODE}"" CompileAll=""1" Shortcuts=0' \
}

# ------------------------------------------------------------------------------------------------------------
# pwsh (PowerShellCore)
#
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/windows-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
runs-on: windows-2019

steps:

- name: Login to docker repository
run: |
${gh_user} = ("${{ github.repository }}" -Split '/')[0]
Expand All @@ -42,5 +43,9 @@ jobs:
${gh_user} = ("${{ github.repository }}" -Split '/')[0]
cd .github\docker\windows
docker build --tag ${gh_user}/rez-test-win:${ENV:DOCKER_TAG} .
echo docker build --tag ${gh_user}/rez-test-win:${ENV:DOCKER_TAG} --build-arg PYTHON_VERSIONS=${ENV:PYTHON_VERSIONS} .
docker build --tag ${gh_user}/rez-test-win:${ENV:DOCKER_TAG} --build-arg PYTHON_VERSIONS=${ENV:PYTHON_VERSIONS} .
docker push ${gh_user}/rez-test-win:${ENV:DOCKER_TAG}
env:
# Must match strategy in windows-docker.yaml
PYTHON_VERSIONS: '2.7.11;3.6.8;3.7.5'

0 comments on commit ca28dfe

Please sign in to comment.