首页 > 其他 > 详细

DockerFile

时间:2019-04-15 23:46:19      阅读:166      评论:0      收藏:0      [点我收藏+]
FROM microsoft/dotnet:2.2-sdk AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM microsoft/dotnet:2.2-aspnetcore-runtime
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]
$ docker build -t aspnetapp .
$ docker run -d -p 8080:80 --name myapp aspnetapp

DockerFile

原文:https://www.cnblogs.com/WNpursue/p/10714019.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!