web api的docker file
#基于 `microsoft/aspnetcore:2.0` 来构建我们的镜像
FROM microsoft/dotnet:2.2-aspnetcore-runtime As base
#拷贝项目publish文件夹中的所有文件到 docker容器中的publish文件夹中
COPY . /publish
#设置工作目录为 `/publish` 文件夹,即容器启动默认的文件夹
WORKDIR /publish
#设置Docker容器对外暴露80端口
EXPOSE 8080
#使用`dotnet NetCoreDockerDemo.dll`来运行应用程序
ENTRYPOINT ["dotnet", "DockerAPI.dll"]
===========
.net core mvc的docker file
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
COPY . .
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["dotnet", "DockerSample.dll"]