Skip to content

Instantly share code, notes, and snippets.

@artisticcheese
Created September 10, 2017 21:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisticcheese/afca60d6f9630e0b04a6d5ce79bbe369 to your computer and use it in GitHub Desktop.
Save artisticcheese/afca60d6f9630e0b04a6d5ce79bbe369 to your computer and use it in GitHub Desktop.
# escape=`
# Image with SDK to build .NET Core application from source
FROM microsoft/aspnetcore-build:2.0.0-nanoserver As builder
WORKDIR /source/
COPY source .
RUN dotnet restore; dotnet publish -c Release
FROM microsoft/aspnetcore:2.0.0-nanoserver
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"]
#Copy dotnet core installation from middleware image
WORKDIR app
# Add local user for testing authentication against local SAM database
RUN new-LocalUser -Name "ContainerAdmin" -Password (ConvertTo-SecureString "A123456!" -AsPlainText -Force); `
Add-LocalGroupMember -Group Administrators -Member "ContainerAdmin" ;
# Copying compiled file from middleware NET CORE builder SDK image
COPY --from=builder /source/bin/Release/netcoreapp2.0/publish .
EXPOSE 80
ENTRYPOINT ["Dotnet", "source.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment