Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitjano committed Apr 27, 2024
1 parent 0a9ebec commit 0e1a5ae
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
# escape=`

# Use the latest Windows Server Core 2022 image.
FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]

RUN `
# Download the Build Tools bootstrapper.
curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe `
`
# Download the Build Tools bootstrapper.
RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe

# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues.
&& (start /w vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools" `
--add Microsoft.VisualStudio.Workload.VCTools `
--includeRecommended `
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) `
`
RUN vs_buildtools.exe --quiet --wait --norestart --nocache \
--installPath "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.VisualStudio.Workload.VCTools \
--includeRecommended \
|| IF "%ERRORLEVEL%"=="3010" EXIT 0 \
# Cleanup
&& del /q vs_buildtools.exe

RUN `
curl -SL --output git.zip https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/MinGit-2.41.0.3-64-bit.zip `
&& mkdir "%ProgramFiles%\Git" `
&& powershell -command "Expand-Archive -Path C:\git.zip -DestinationPath '%ProgramFiles%\git'" `
&& powershell -command "(Get-Content 'C:/Program Files/Git/etc/gitconfig') -replace 'path = C:/Program Files/Git/etc/gitconfig', '' | Set-Content 'C:/Program Files/Git/etc/gitconfig'" `
&& del /q git.zip `
RUN curl -SL --output git.zip https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/MinGit-2.41.0.3-64-bit.zip \
&& mkdir "%ProgramFiles%\Git" \
&& powershell -command "Expand-Archive -Path C:\git.zip -DestinationPath '%ProgramFiles%\git'" \
&& powershell -command "(Get-Content 'C:/Program Files/Git/etc/gitconfig') -replace 'path = C:/Program Files/Git/etc/gitconfig', '' | Set-Content 'C:/Program Files/Git/etc/gitconfig'" \
&& del /q git.zip \
&& SETX /M PATH "%ProgramFiles%\Git\cmd;%ProgramFiles%\Git\mingw64\bin;%ProgramFiles%\Git\usr\bin;%PATH%

RUN `
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg `
&& cd vcpkg `
&& bootstrap-vcpkg.bat `
&& SETX /M PATH "C:\vcpkg;%PATH%" `
&& vcpkg install zlib:x64-windows --clean-after-build `
RUN git clone https://github.com/microsoft/vcpkg.git C:\vcpkg \
&& cd vcpkg \
&& bootstrap-vcpkg.bat \
&& SETX /M PATH "C:\vcpkg;%PATH%" \
&& vcpkg install zlib:x64-windows --clean-after-build \
&& vcpkg remove zlib:x64-windows

# Define the entry point for the docker container.
Expand Down

0 comments on commit 0e1a5ae

Please sign in to comment.