Created
October 24, 2018 09:04
-
-
Save jonasbg/cf84879a540a925a6e33146fd05c839c to your computer and use it in GitHub Desktop.
Build Dockerfile for legacy ASP.NET project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# escape=` | |
FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-1803 | |
ENV SOLUTION_NAME Solutionfile.sln | |
ENV PUBLISH_PROFILE Release | |
RUN mkdir C:\api | |
WORKDIR C:\\api | |
COPY . . | |
RUN nuget restore %SOLUTION_NAME% | |
RUN msbuild "C:\\api\\%SOLUTION_NAME%" ` | |
/nologo /p:DeployOnBuild=True /p:PublishProfile=%PUBLISH_PROFILE% /p:configuration="Release" ` | |
/p:VisualStudioVersion="15.0" ` | |
/p:AspnetMergePath='"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.7.2 Tools"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build with
docker build -t jonasbg/tag .
Testrun with
docker run -it --rm jonasbg/tag powershell
Remember to run Docker with windows containers