Docker常用操作

常用命令:
— 创建镜像
docker build -t testweb .
— 运行镜像
docker run -i -t -p 7777:80 jpwx3 /bin/bash
— 查看容器状态
docker ps -a
— 启动容器
docker start d7f56f472cdb
— 日志
docker logs d7f56f472cdb

.netCore下常用Dockerfile设置:
FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /app
EXPOSE 51559
EXPOSE 44326

FROM microsoft/dotnet:2.1-aspnetcore-runtime
WORKDIR /app
EXPOSE 51559
EXPOSE 44326

FROM microsoft/dotnet:2.1-sdk
WORKDIR /app
COPY . .
EXPOSE 80

ENTRYPOINT [“dotnet”, “Mycos.UnifiedCertification.dll”]

dockerfile关系图:

发表评论