Created
September 21, 2018 14:57
-
-
Save allanchua101/a5cb3894f5b0c382a92516283bc79ae4 to your computer and use it in GitHub Desktop.
Multistage Dockerfile using Alpine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM microsoft/dotnet:sdk AS build-env | |
| WORKDIR /app | |
| COPY *.csproj ./ | |
| RUN dotnet restore | |
| COPY . ./ | |
| RUN dotnet publish -c Release -o out | |
| # Pay attention to the following two lines | |
| FROM microsoft/dotnet-nightly:2.1-runtime-alpine | |
| # Alpine runtime doesn't expose 80 by default (Dang) | |
| EXPOSE 80 | |
| WORKDIR /app | |
| COPY --from=build-env /app/out . | |
| # Replace Ledger.dll depending on which project | |
| # are you containerizing. | |
| ENTRYPOINT ["dotnet", "Ledger.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment