Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # A simple test using multi-stage builds in Docker to create a simple console app using dotnet core
- # if only using the sdk, the image size is 1.7GB. Using multi-stage build the size is reduced to 180mb
- FROM microsoft/dotnet:2.1-sdk AS build
- ## creates and builds the app
- RUN dotnet new console -lang "c#" -n testapp
- RUN cd testapp
- WORKDIR /testapp/
- RUN dotnet build -c Release -o output
- # uses output from build step and runs the dll
- FROM microsoft/dotnet:2.1-runtime AS runtime
- COPY --from=build /testapp/output .
- ENTRYPOINT ["dotnet", "testapp.dll"]
Add Comment
Please, Sign In to add comment