Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlesne committed Oct 31, 2024
1 parent bd9f2df commit 56ab0a7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
38 changes: 19 additions & 19 deletions src/docker/Dockerfile-win-ltsc2019
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2019@sha256:64ae795d
# Configure local user
USER ContainerAdministrator
SHELL ["cmd", "/S", "/C"]
ENV HOME=C:\app-root
ENV HOME=C:\\app-root

# Avoid Python cache during build
ENV PYTHONDONTWRITEBYTECODE=1

# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION=${POWERSHELL_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors "https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/PowerShell-${POWERSHELL_VERSION}-win-x64.msi" -o powershell.msi \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/PowerShell/PowerShell/releases/download/v${Env:POWERSHELL_VERSION}/PowerShell-${Env:POWERSHELL_VERSION}-win-x64.msi' -o powershell.msi \
&& msiexec.exe /i powershell.msi /qn /norestart \
&& del /q powershell.msi
RUN pwsh -Version
Expand All @@ -25,15 +25,15 @@ SHELL ["pwsh", "-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActio
# See: https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022#create-and-build-the-dockerfile
ARG VS_BUILDTOOLS_VERSION
ENV VS_BUILDTOOLS_VERSION=${VS_BUILDTOOLS_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://download.visualstudio.microsoft.com/download/pr/${VS_BUILDTOOLS_VERSION}/vs_BuildTools.exe' -o vs_buildtools.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://download.visualstudio.microsoft.com/download/pr/${Env:VS_BUILDTOOLS_VERSION}/vs_BuildTools.exe' -o vs_buildtools.exe \
&& Start-Process \
vs_buildtools.exe \
-ArgumentList '--includeOptional --includeRecommended --installPath ''C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools'' --nocache --norestart --quiet --wait --add Microsoft.VisualStudio.Workload.AzureBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.WebBuildTools --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.OfficeBuildTools' \
-Wait \
&& Remove-Item vs_buildtools.exe
ENV MSBuildExtensionsPath='C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools'
ENV MSBuildExtensionsPath='C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools'
ENV MSBuildExtensionsPath32=${MSBuildExtensionsPath}
ENV MSBuildBinPath=${MSBuildExtensionsPath}\MSBuild\15.0\Bin
ENV MSBuildBinPath=${MSBuildExtensionsPath}\\MSBuild\\15.0\\Bin
SHELL ["pwsh", "-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; & '${MSBuildExtensionsPath}\\Common7\\Tools\\VsDevCmd.bat';"]
RUN msbuild --version \
cpp --version \
Expand All @@ -42,7 +42,7 @@ RUN msbuild --version \
# Install Git, then verify installation
ARG GIT_VERSION
ENV GIT_VERSION=${GIT_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/Git-${GIT_VERSION}-64-bit.exe' -o git.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/git-for-windows/git/releases/download/v${Env:GIT_VERSION}.windows.1/Git-${Env:GIT_VERSION}-64-bit.exe' -o git.exe \
&& Start-Process \
git.exe \
-ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP-' \
Expand All @@ -54,7 +54,7 @@ RUN git --version
ARG JQ_VERSION
ENV JQ_VERSION=${JQ_VERSION}
RUN mkdir 'C:\Program Files\jq' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-win64.exe' -o 'C:\Program Files\jq\jq.exe' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/stedolan/jq/releases/download/jq-${Env:JQ_VERSION}/jq-win64.exe' -o 'C:\Program Files\jq\jq.exe' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\jq', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN jq --version
Expand All @@ -63,7 +63,7 @@ RUN jq --version
# TODO: Clean up "__pycache__" folders on disk
ARG PYTHON_VERSION
ENV PYTHON_VERSION=${PYTHON_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe' -o python.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://python.org/ftp/python/${Env:PYTHON_VERSION}/python-${Env:PYTHON_VERSION}-amd64.exe' -o python.exe \
&& Start-Process \
python.exe \
-ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 Include_test=0' \
Expand All @@ -89,13 +89,13 @@ RUN python3 -m pip \
--no-cache-dir \
--quiet \
install \
'azure-cli==${AZURE_CLI_VERSION}' \
'azure-cli==${Env:AZURE_CLI_VERSION}' \
&& az version

# Install AWS CLI, then verify installation
ARG AWS_CLI_VERSION
ENV AWS_CLI_VERSION=${AWS_CLI_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://awscli.amazonaws.com/AWSCLIV2-${AWS_CLI_VERSION}.msi' -o awscli.msi \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://awscli.amazonaws.com/AWSCLIV2-${Env:AWS_CLI_VERSION}.msi' -o awscli.msi \
&& Start-Process \
msiexec.exe \
-ArgumentList '/I awscli.msi /qn /norestart' \
Expand All @@ -106,7 +106,7 @@ RUN aws --version
# Install Google Cloud CLI, then verify installation
ARG GCLOUD_CLI_VERSION
ENV GCLOUD_CLI_VERSION=${GCLOUD_CLI_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_CLI_VERSION}-windows-x86_64.zip' -o gcloud.zip \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${Env:GCLOUD_CLI_VERSION}-windows-x86_64.zip' -o gcloud.zip \
&& Expand-Archive -Force gcloud.zip -DestinationPath 'C:\Program Files' \
&& Remove-Item gcloud.zip \
&& Rename-Item 'C:\Program Files\google-cloud-sdk' 'gcloud' \
Expand All @@ -121,38 +121,38 @@ RUN gcloud version
ARG YQ_VERSION
ENV YQ_VERSION=${YQ_VERSION}
RUN mkdir 'C:\Program Files\yq' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_windows_amd64.exe' -o 'C:\Program Files\yq\yq.exe' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/mikefarah/yq/releases/download/v${Env:YQ_VERSION}/yq_windows_amd64.exe' -o 'C:\Program Files\yq\yq.exe' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\yq', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN yq --version

# Install Azure Pipelines Agent sources, then verify installation
ARG AZP_AGENT_VERSION
ENV AZP_AGENT_VERSION=${AZP_AGENT_VERSION}
ENV AZP_HOME='${HOME}\azp-agent'
ENV AZP_HOME=${HOME}\\azp-agent
# Disable agent auto-updates
# See: https://github.com/microsoft/azure-pipelines-agent/blob/b5ff4408239f3e938560f8b2e3848df76489a8d0/src/Agent.Listener/Agent.cs#L354C24-L354C24
ENV agent.disableupdate=1
RUN mkdir $AZP_HOME \
&& curl -LsSf --retry 8 --retry-all-errors 'https://vstsagentpackage.azureedge.net/agent/${AZP_AGENT_VERSION}/vsts-agent-win-x64-${AZP_AGENT_VERSION}.zip' -o azp-agent.zip \
&& curl -LsSf --retry 8 --retry-all-errors 'https://vstsagentpackage.azureedge.net/agent/${Env:AZP_AGENT_VERSION}/vsts-agent-win-x64-${Env:AZP_AGENT_VERSION}.zip' -o azp-agent.zip \
&& Expand-Archive -Force azp-agent.zip -DestinationPath $AZP_HOME \
&& Remove-Item azp-agent.zip \
&& & '${AZP_HOME}\run.cmd' --version
ENV AZP_WORK='(${HOME}\azp-work'
&& & '${Env:AZP_HOME}\run.cmd' --version
ENV AZP_WORK=${HOME}\\azp-work

# Install zstd, then verify installation
ARG ZSTD_VERSION
ENV ZSTD_VERSION=${ZSTD_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-v${ZSTD_VERSION}-win64.zip' -o zstd.zip \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/facebook/zstd/releases/download/v${Env:ZSTD_VERSION}/zstd-v${Env:ZSTD_VERSION}-win64.zip' -o zstd.zip \
&& Expand-Archive -Force zstd.zip -DestinationPath 'C:\Program Files' \
&& Remove-Item zstd.zip \
&& Rename-Item 'C:\Program Files\zstd-v${ZSTD_VERSION}-win64' 'zstd' \
&& Rename-Item 'C:\Program Files\zstd-v${Env:ZSTD_VERSION}-win64' 'zstd' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\zstd', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN zstd --version

# Define path for the custom SSL certificate
ENV AZP_CUSTOM_CERT_PEM=${HOME}\azp-custom-certs
ENV AZP_CUSTOM_CERT_PEM=${HOME}\\azp-custom-certs

# Reset Python configs to default
ENV PYTHONDONTWRITEBYTECODE=
Expand Down
38 changes: 19 additions & 19 deletions src/docker/Dockerfile-win-ltsc2022
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022@sha256:a5daa91a
# Configure local user
USER ContainerAdministrator
SHELL ["cmd", "/S", "/C"]
ENV HOME=C:\app-root
ENV HOME=C:\\app-root

# Avoid Python cache during build
ENV PYTHONDONTWRITEBYTECODE=1

# Install Powershell, then verify installation
ARG POWERSHELL_VERSION
ENV POWERSHELL_VERSION=${POWERSHELL_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors "https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/PowerShell-${POWERSHELL_VERSION}-win-x64.msi" -o powershell.msi \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/PowerShell/PowerShell/releases/download/v${Env:POWERSHELL_VERSION}/PowerShell-${Env:POWERSHELL_VERSION}-win-x64.msi' -o powershell.msi \
&& msiexec.exe /i powershell.msi /qn /norestart \
&& del /q powershell.msi
RUN pwsh -Version
Expand All @@ -25,15 +25,15 @@ SHELL ["pwsh", "-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActio
# See: https://learn.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2022#create-and-build-the-dockerfile
ARG VS_BUILDTOOLS_VERSION
ENV VS_BUILDTOOLS_VERSION=${VS_BUILDTOOLS_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://download.visualstudio.microsoft.com/download/pr/${VS_BUILDTOOLS_VERSION}/vs_BuildTools.exe' -o vs_buildtools.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://download.visualstudio.microsoft.com/download/pr/${Env:VS_BUILDTOOLS_VERSION}/vs_BuildTools.exe' -o vs_buildtools.exe \
&& Start-Process \
vs_buildtools.exe \
-ArgumentList '--includeOptional --includeRecommended --installPath ''C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools'' --nocache --norestart --quiet --wait --add Microsoft.VisualStudio.Workload.AzureBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.WebBuildTools --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.OfficeBuildTools' \
-Wait \
&& Remove-Item vs_buildtools.exe
ENV MSBuildExtensionsPath='C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools'
ENV MSBuildExtensionsPath='C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools'
ENV MSBuildExtensionsPath32=${MSBuildExtensionsPath}
ENV MSBuildBinPath=${MSBuildExtensionsPath}\MSBuild\15.0\Bin
ENV MSBuildBinPath=${MSBuildExtensionsPath}\\MSBuild\\15.0\\Bin
SHELL ["pwsh", "-NoLogo", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; & '${MSBuildExtensionsPath}\\Common7\\Tools\\VsDevCmd.bat';"]
RUN msbuild --version \
cpp --version \
Expand All @@ -42,7 +42,7 @@ RUN msbuild --version \
# Install Git, then verify installation
ARG GIT_VERSION
ENV GIT_VERSION=${GIT_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/Git-${GIT_VERSION}-64-bit.exe' -o git.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/git-for-windows/git/releases/download/v${Env:GIT_VERSION}.windows.1/Git-${Env:GIT_VERSION}-64-bit.exe' -o git.exe \
&& Start-Process \
git.exe \
-ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP-' \
Expand All @@ -54,7 +54,7 @@ RUN git --version
ARG JQ_VERSION
ENV JQ_VERSION=${JQ_VERSION}
RUN mkdir 'C:\Program Files\jq' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-win64.exe' -o 'C:\Program Files\jq\jq.exe' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/stedolan/jq/releases/download/jq-${Env:JQ_VERSION}/jq-win64.exe' -o 'C:\Program Files\jq\jq.exe' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\jq', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN jq --version
Expand All @@ -63,7 +63,7 @@ RUN jq --version
# TODO: Clean up "__pycache__" folders on disk
ARG PYTHON_VERSION
ENV PYTHON_VERSION=${PYTHON_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-amd64.exe' -o python.exe \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://python.org/ftp/python/${Env:PYTHON_VERSION}/python-${Env:PYTHON_VERSION}-amd64.exe' -o python.exe \
&& Start-Process \
python.exe \
-ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 Include_test=0' \
Expand All @@ -89,13 +89,13 @@ RUN python3 -m pip \
--no-cache-dir \
--quiet \
install \
'azure-cli==${AZURE_CLI_VERSION}' \
'azure-cli==${Env:AZURE_CLI_VERSION}' \
&& az version

# Install AWS CLI, then verify installation
ARG AWS_CLI_VERSION
ENV AWS_CLI_VERSION=${AWS_CLI_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://awscli.amazonaws.com/AWSCLIV2-${AWS_CLI_VERSION}.msi' -o awscli.msi \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://awscli.amazonaws.com/AWSCLIV2-${Env:AWS_CLI_VERSION}.msi' -o awscli.msi \
&& Start-Process \
msiexec.exe \
-ArgumentList '/I awscli.msi /qn /norestart' \
Expand All @@ -106,7 +106,7 @@ RUN aws --version
# Install Google Cloud CLI, then verify installation
ARG GCLOUD_CLI_VERSION
ENV GCLOUD_CLI_VERSION=${GCLOUD_CLI_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_CLI_VERSION}-windows-x86_64.zip' -o gcloud.zip \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${Env:GCLOUD_CLI_VERSION}-windows-x86_64.zip' -o gcloud.zip \
&& Expand-Archive -Force gcloud.zip -DestinationPath 'C:\Program Files' \
&& Remove-Item gcloud.zip \
&& Rename-Item 'C:\Program Files\google-cloud-sdk' 'gcloud' \
Expand All @@ -121,38 +121,38 @@ RUN gcloud version
ARG YQ_VERSION
ENV YQ_VERSION=${YQ_VERSION}
RUN mkdir 'C:\Program Files\yq' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_windows_amd64.exe' -o 'C:\Program Files\yq\yq.exe' \
&& curl -LsSf --retry 8 --retry-all-errors 'https://github.com/mikefarah/yq/releases/download/v${Env:YQ_VERSION}/yq_windows_amd64.exe' -o 'C:\Program Files\yq\yq.exe' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\yq', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN yq --version

# Install Azure Pipelines Agent sources, then verify installation
ARG AZP_AGENT_VERSION
ENV AZP_AGENT_VERSION=${AZP_AGENT_VERSION}
ENV AZP_HOME='${HOME}\azp-agent'
ENV AZP_HOME=${HOME}\\azp-agent
# Disable agent auto-updates
# See: https://github.com/microsoft/azure-pipelines-agent/blob/b5ff4408239f3e938560f8b2e3848df76489a8d0/src/Agent.Listener/Agent.cs#L354C24-L354C24
ENV agent.disableupdate=1
RUN mkdir $AZP_HOME \
&& curl -LsSf --retry 8 --retry-all-errors 'https://vstsagentpackage.azureedge.net/agent/${AZP_AGENT_VERSION}/vsts-agent-win-x64-${AZP_AGENT_VERSION}.zip' -o azp-agent.zip \
&& curl -LsSf --retry 8 --retry-all-errors 'https://vstsagentpackage.azureedge.net/agent/${Env:AZP_AGENT_VERSION}/vsts-agent-win-x64-${Env:AZP_AGENT_VERSION}.zip' -o azp-agent.zip \
&& Expand-Archive -Force azp-agent.zip -DestinationPath $AZP_HOME \
&& Remove-Item azp-agent.zip \
&& & '${AZP_HOME}\run.cmd' --version
ENV AZP_WORK='(${HOME}\azp-work'
&& & '${Env:AZP_HOME}\run.cmd' --version
ENV AZP_WORK=${HOME}\\azp-work

# Install zstd, then verify installation
ARG ZSTD_VERSION
ENV ZSTD_VERSION=${ZSTD_VERSION}
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-v${ZSTD_VERSION}-win64.zip' -o zstd.zip \
RUN curl -LsSf --retry 8 --retry-all-errors 'https://github.com/facebook/zstd/releases/download/v${Env:ZSTD_VERSION}/zstd-v${Env:ZSTD_VERSION}-win64.zip' -o zstd.zip \
&& Expand-Archive -Force zstd.zip -DestinationPath 'C:\Program Files' \
&& Remove-Item zstd.zip \
&& Rename-Item 'C:\Program Files\zstd-v${ZSTD_VERSION}-win64' 'zstd' \
&& Rename-Item 'C:\Program Files\zstd-v${Env:ZSTD_VERSION}-win64' 'zstd' \
&& [Environment]::SetEnvironmentVariable('Path', $Env:Path + ';C:\Program Files\zstd', [EnvironmentVariableTarget]::Machine)
# hadolint ignore=DL3059
RUN zstd --version

# Define path for the custom SSL certificate
ENV AZP_CUSTOM_CERT_PEM=${HOME}\azp-custom-certs
ENV AZP_CUSTOM_CERT_PEM=${HOME}\\azp-custom-certs

# Reset Python configs to default
ENV PYTHONDONTWRITEBYTECODE=
Expand Down

0 comments on commit 56ab0a7

Please sign in to comment.