Skip to content

Instantly share code, notes, and snippets.

@jinhduong
Created July 19, 2018 04:20
Show Gist options
  • Save jinhduong/517de55b2e4a2848a703e8cf0a7e86d0 to your computer and use it in GitHub Desktop.
Save jinhduong/517de55b2e4a2848a703e8cf0a7e86d0 to your computer and use it in GitHub Desktop.
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 .
CMD [ "dotnet","dotnet_demo_webapi.dll" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment