Skip to content

Instantly share code, notes, and snippets.

@rkttu
Created April 28, 2022 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkttu/62d244efed978174ede21094412552d3 to your computer and use it in GitHub Desktop.
Save rkttu/62d244efed978174ede21094412552d3 to your computer and use it in GitHub Desktop.
LINQPad runner running on Windows Container
FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2022 AS build
RUN powershell.exe -Command \
Invoke-WebRequest -UseBasicParsing 'https://www.linqpad.net/GetFile.aspx?LINQPad7Setup.exe' -OutFile "$home/LINQPad7Setup.exe"; \
Start-Process -FilePath "$home/LINQPad7Setup.exe" -ArgumentList "/SP-","/VERYSILENT","/SUPPRESSMSGBOXES","/NORESTART","/NOICONS" -NoNewWindow -Wait; \
rm -Force "$home/LINQPad7Setup.exe"; && \
setx.exe /M PATH "%PROGRAMFILES%\LINQPad7;%PATH%"
FROM build
ADD Program.linq .
RUN lprun7.exe Program.linq && exit 0
<Query Kind="Statements">
<IncludeUncapsulator>false</IncludeUncapsulator>
<IncludeLinqToSql>true</IncludeLinqToSql>
<IncludeAspNet>true</IncludeAspNet>
<RuntimeVersion>6.0</RuntimeVersion>
</Query>
await Console.Out.WriteLineAsync("Hello, World!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment