码迷,mamicode.com
首页 > Web开发 > 详细

NETCORE 之 openSUSE docker 安装

时间:2019-03-25 14:39:29      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:仓库   api   status   tps   div   systemctl   .com   成功   emctl   

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

#容器中使用 ["dotnet","系统启动的dll"] 来运行应用程序
#使用ENTRYPOINT ["dotnet","系统启动的dll"]
#或使用 CMD ["dotnet","系统启动的dll"]

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 安装

标签:仓库   api   status   tps   div   systemctl   .com   成功   emctl   

原文地址:https://www.cnblogs.com/kelelipeng/p/10593533.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!