github.com/Azure/aad-pod-identity@v1.8.17/examples/rest-api/service/Dockerfile (about)

     1  #	Multi-stage docker build file (see https://docs.docker.com/develop/develop-images/multistage-build/)
     2  #	Use a Microsoft image with .NET core runtime (https://hub.docker.com/r/microsoft/dotnet/tags/)
     3  FROM microsoft/dotnet:2.2-sdk AS build
     4  
     5  WORKDIR /src
     6  
     7  #	Copy source code into the source folder
     8  COPY MyApiSolution .
     9  
    10  #	Publish the app into the app folder
    11  RUN dotnet publish MyApi -c release -o app
    12  
    13  ###########################################################
    14  #	Final container image
    15  #	Use a Microsoft image with .NET core runtime (https://hub.docker.com/r/microsoft/dotnet/tags/)
    16  FROM microsoft/dotnet:2.2-aspnetcore-runtime AS final
    17  
    18  #	Set the working directory to /work
    19  WORKDIR /work
    20  
    21  #	Copy package
    22  COPY --from=build /src/MyApi/app .
    23  
    24  # Make port 80 available to the world outside this container
    25  
    26  EXPOSE 80
    27  
    28  #	Run console app
    29  CMD ["dotnet", "MyApi.dll"]