Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created August 24, 2018 08:05
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 PradeepLoganathan/08aed75678bf0c105d19ac5a2432cd0b to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/08aed75678bf0c105d19ac5a2432cd0b to your computer and use it in GitHub Desktop.
Simple dockerfile for a console application
FROM microsoft/dotnet:2.1-runtime AS base
WORKDIR /app
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY thetime/thetime.csproj thetime/
RUN dotnet restore thetime/thetime.csproj
COPY . .
WORKDIR /src/thetime
RUN dotnet build thetime.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish thetime.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "thetime.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment