1、安装Docker
yum install curl -y curl -fsSL https://get.docker.com/ | sh
2、编写Dockerfile文件
FROM microsoft/dotnet:2.1-aspnetcore-runtime WORKDIR /app COPY publish/ . ENTRYPOINT ["dotnet", "Tiantianquan.Contraceptive.Web.dll"]
3、生成镜像,运行镜像
docker build -t yj.test.cn . docker run -d -p 8000:80 yj.test.cn --restart=always docker ps