From 735c8200950403e5cea30256cd62b91ef525a743 Mon Sep 17 00:00:00 2001 From: Blazej Floch Date: Mon, 4 Nov 2019 11:06:15 -0500 Subject: [PATCH] Reduce Image size by deleting temporary chocolatey files. --- .github/docker/rez-win-base/Dockerfile | 7 +++++++ .github/docker/rez-win-py/Dockerfile | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/.github/docker/rez-win-base/Dockerfile b/.github/docker/rez-win-base/Dockerfile index 862f185cd8..a1022a8c0f 100644 --- a/.github/docker/rez-win-base/Dockerfile +++ b/.github/docker/rez-win-base/Dockerfile @@ -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"] diff --git a/.github/docker/rez-win-py/Dockerfile b/.github/docker/rez-win-py/Dockerfile index a3b3c25597..628c3c8758 100644 --- a/.github/docker/rez-win-py/Dockerfile +++ b/.github/docker/rez-win-py/Dockerfile @@ -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"]