Guest User

Untitled

a guest
Jul 16th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # A simple test using multi-stage builds in Docker to create a simple console app using dotnet core
  2. # if only using the sdk, the image size is 1.7GB. Using multi-stage build the size is reduced to 180mb
  3.  
  4. FROM microsoft/dotnet:2.1-sdk AS build
  5.  
  6. ## creates and builds the app
  7. RUN dotnet new console -lang "c#" -n testapp
  8. RUN cd testapp
  9. WORKDIR /testapp/
  10. RUN dotnet build -c Release -o output
  11.  
  12. # uses output from build step and runs the dll
  13. FROM microsoft/dotnet:2.1-runtime AS runtime
  14. COPY --from=build /testapp/output .
  15. ENTRYPOINT ["dotnet", "testapp.dll"]
Add Comment
Please, Sign In to add comment