Skip to content

Instantly share code, notes, and snippets.

@subhankars
Created June 17, 2019 14:22
Show Gist options
  • Save subhankars/fd359ebafcfdb5480d5e75d606b9ae14 to your computer and use it in GitHub Desktop.
Save subhankars/fd359ebafcfdb5480d5e75d606b9ae14 to your computer and use it in GitHub Desktop.
Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 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 mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "first-docker.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment