NETCORE 之 openSUSE docker 安装
Posted kelelipeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NETCORE 之 openSUSE docker 安装相关的知识,希望对你有一定的参考价值。
openSUSE docker 安装
https://www.jianshu.com/p/c725a06447d5
http://www.importnew.com/24684.html
Suse安装Docker
https://blog.csdn.net/llqkk/article/details/50488870
1. 添加仓库
##zypper addrepo -f cd:///?devices=/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00003 SLES12-SP2-12
zypper addrepo -f https://mirrors.aliyun.com/opensuse/update/leap/42.3/oss openSUSE-42.3-Update-Oss
zypper addrepo -f https://mirrors.aliyun.com/opensuse/update/leap/42.3/non-oss/ openSUSE-42.3-Update-Non-Oss
zypper addrepo -f https://mirrors.aliyun.com/opensuse/distribution/leap/42.3/repo/oss/ openSUSE-42.3-Oss
zypper addrepo -f https://mirrors.aliyun.com/opensuse/distribution/leap/42.3/repo/non-oss/ openSUSE-42.3-Non-Oss
zypper addrepo -f https://mirrors.aliyun.com/packman/openSUSE_Leap_42.3/ aliyun-packman
2.升级软件及内核
zypper update
3. 安装 Docker 包
zypper install docker
4.启动 docker
systemctl start docker
systemctl status docker
5.开机自启动
systemctl enable docker
6. add 到 docker组
/usr/sbin/usermod -aG docker root
7.***拉取 dotnet image
docker pull microsoft/dotnet
docker pull microsoft/dotnet:2.2-aspnetcore-runtime
docker pull microsoft/dotnet:2.1-aspnetcore-runtime
8. # https://blog.csdn.net/woniu211111/article/details/80970560
docker pull redis:4.0
9.https://www.cnblogs.com/li5206610/p/9284647.html
docker pull mysql:5.7.19
10.测试docker安装成功否
docker run hello-world
DOTNETCORE
在Docker中部署Asp.net core2.1以及修改发布
https://blog.csdn.net/sd7o95o/article/details/80809734
docker exec 的使用-it操作
https://blog.csdn.net/qq_40081976/article/details/84590119
docker 部署 webapi 示例 (注意这里一定要这样指定端口号)
https://blog.csdn.net/u014690615/article/details/83590412
B__________________Dockerfile___________________________
# 添加基础镜像
FROM microsoft/dotnet
#容器中系统的工作空间
WORKDIR /app
#拷贝当前文件夹下的文件到容器中系统的工作空间
COPY . /app
#设置Docker容器对外暴露的端口
EXPOSE 64366
ENTRYPOINT ["dotnet", "WebApi.dll"]
_____________________________________________________
C__________________NETCORE 镜像制作及发布 ***测试成功***_________________
1.到发布目录建立镜像
/mytest/CoreWebApi/publish # docker build -t webapitestdocker .
2.查看镜像
docker images
3.建立镜像容器
/mytest/CoreWebApi/publish # docker run --name mywebapi -d -p 64366:64366 webapitestdocker
4.测试
curl http://127.0.0.1:64366/api/ts
____________________________________________________________________
以上是关于NETCORE 之 openSUSE docker 安装的主要内容,如果未能解决你的问题,请参考以下文章