Skip to content

Instantly share code, notes, and snippets.

@jaredpar
Last active February 3, 2021 20:12
Show Gist options
  • Select an option

  • Save jaredpar/c2ee34e5a9e4cfa8f46229aba277a345 to your computer and use it in GitHub Desktop.

Select an option

Save jaredpar/c2ee34e5a9e4cfa8f46229aba277a345 to your computer and use it in GitHub Desktop.
Roslyn CI Dockerfile
# escape=`
FROM mcr.microsoft.com/windows/servercore:10.0.19042.746-amd64
ENV `
GIT_SHA=dc05143487a23b10b1c4c87a0c55aa69c7451386
# Use PowerShell as the default shell
SHELL ["powershell", "-command"]
# Install Git
WORKDIR C:\git
RUN `
$ErrorActionPreference = 'Stop'; `
$ProgressPreference = 'SilentlyContinue'; `
Invoke-WebRequest -OutFile git.7z.exe https://github.com/git-for-windows/git/releases/download/v2.30.0.windows.2/PortableGit-2.30.0.2-32-bit.7z.exe; `
Install-Package PS7Zip -Force; `
Expand-7Zip git.7z.exe;
SHELL ["cmd"]
RUN setx /M PATH "C:\git\cmd;%PATH%"
RUN setx /M PATH "C:\dotnet;%PATH%"
# Now let's check out roslyn
SHELL ["powershell", "-command"]
WORKDIR c:\roslyn
RUN C:\git\cmd\git.exe --version
RUN C:\git\cmd\git.exe init
RUN C:\git\cmd\git.exe remote add origin https://github.com/dotnet/roslyn
RUN C:\git\cmd\git.exe fetch --depth 1 origin $env:GIT_SHA
RUN C:\git\cmd\git.exe checkout -B temp $env:GIT_SHA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment