有图版:http://note.youdao.com/noteshare?id=a3ffb86d981a79e9fb59054d35883346
1,先发布
2,在刚刚发布的pulish文件夹中创建"Dockerfile"文件(无后缀名)
编辑文件内容:
#基于 `microsoft/dotnet:1.0.0-core` 来构建我们的镜像
FROM microsoft/dotnet:2.2-aspnetcore-runtime
#拷贝项目publish文件夹中的所有文件到 docker容器中的publish文件夹中
COPY . /publish
#设置工作目录为 `/publish` 文件夹,即容器启动默认的文件夹
WORKDIR /publish
#设置Docker容器对外暴露8003端口
#EXPOSE 8003
#使用`dotnet testmvc.dll`来运行应用程序
CMD ["dotnet", "NETCoreDayReminder.dll"]
3,把整个pulish文件夹 拷到linux
4,运行linux SSH cd到pulish(刚刚拷到哪里路径就是哪里)
5,执行打包命令
#139069910是我docker账号,netcoredayreminder是主程序文件名,latest是TAG号
docker build -t 139069910/netcoredayreminder:latest .