Skip to content

Instantly share code, notes, and snippets.

@sjwaight
Created October 22, 2017 10:28
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 sjwaight/a901df3b8a0149369074d7cbfd112a89 to your computer and use it in GitHub Desktop.
Save sjwaight/a901df3b8a0149369074d7cbfd112a89 to your computer and use it in GitHub Desktop.
Dockerfile to use with Visual Studio Team Services Build Agent.
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "SiliconValve.Vsts.DockerDemo.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment