Skip to content

Commit

Permalink
Reduce Image size by deleting temporary chocolatey files.
Browse files Browse the repository at this point in the history
  • Loading branch information
bfloch committed Nov 4, 2019
1 parent 0666152 commit 9f83ddc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/docker/rez-win-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,11 @@ RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/insta
choco install cmake --yes --version=${ENV:CMAKE_VERSION} --installargs 'ADD_CMAKE_TO_PATH=System'; `
choco install pwsh --yes --version=${PWSH_VERSION};

# ------------------------------------------------------------------------------------------------------------
# Reduce image size
#
RUN choco install --yes choco-cleaner; `
C:\ProgramData\chocolatey\bin\choco-cleaner.ps1; `
choco uninstall --yes choco-cleaner

ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass"]
7 changes: 7 additions & 0 deletions .github/docker/rez-win-py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ RUN $python_relative_ver = (& python --version 2>&1).ToString().Trim().Split(" "
$python_explicit_ver = (& C:\python\python.exe --version 2>&1).ToString().Trim().Split(" ")[1]; `
if (-not ($python_explicit_ver -eq $python_relative_ver -and $python_explicit_ver -eq ${ENV:PYTHON_VERSION})) {exit 1};

# ------------------------------------------------------------------------------------------------------------
# Reduce image size
#
RUN choco install --yes choco-cleaner; `
C:\ProgramData\chocolatey\bin\choco-cleaner.ps1; `
choco uninstall --yes choco-cleaner

COPY entrypoint.ps1 /entrypoint.ps1

ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "ByPass", "-File", "/entrypoint.ps1"]
1 change: 0 additions & 1 deletion .github/workflows/windows-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ on:
- '.github/workflows/windows-docker-image.yaml'

jobs:

# ----------------------------------------------------------------------------
# Create base image if necessary
#
Expand Down

0 comments on commit 9f83ddc

Please sign in to comment.