当前位置: 移动技术网 > IT编程>开发语言>.net > Docker运行dotnetcore

Docker运行dotnetcore

2019年08月07日  | 移动技术网IT编程  | 我要评论

姜育恒歌曲大全,从零开始全集,武井咲不良照片

 

安装centos7 mini

安装 docker,参考

 

@@@code

yum install docker-ce

#安装 19.0.3

@@#

拉取测试镜像

@@@code

docker pull hello-world

[root@docker ~]# docker run hello-world

 

hello from docker!

this message shows that your installation appears to be working correctly.

 

to generate this message, docker took the following steps:

1. the docker client contacted the docker daemon.

2. the docker daemon pulled the "hello-world" image from the docker hub.

(amd64)

3. the docker daemon created a new container from that image which runs the

executable that produces the output you are currently reading.

4. the docker daemon streamed that output to the docker client, which sent it

to your terminal.

 

to try something more ambitious, you can run an ubuntu container with:

$ docker run -it ubuntu bash

 

share images, automate workflows, and more with a free docker id:

https://hub.docker.com/

 

for more examples and ideas, visit:

https://docs.docker.com/get-started/

 

@@#

 

 

拉取镜像

 

参考https://www.bbsmax.com/a/rnjw1e0bdq/

@@@code

docker pull mcr.microsoft.com/dotnet/core/sdk:2.2

docker images

docker run -itd --rm -p 80:80 --name core_test mcr.microsoft.com/dotnet/core/sdk:2.2

docker ps

docker attach core_test

# docker rm core_test

@@#

 

 

容器持久化与移除

 

进入docker执行命令

 

在vs2017中发布应用

 

 

 

@@@code

docker build -t test:1.0 . # 注意最后有一个小点.

docker run -itd -p 80:80 --name test test:1.0 #在浏览器中打开

@@#

 

dockerfile

@@@code

from mcr.microsoft.com/dotnet/core/sdk:2.2 as base

workdir /app

copy ./test /app

expose 80

 

 

entrypoint ["dotnet", "webapplication1.dll"]

@@#

 

 

 

可能发生的错误

 

 

防火墙操作 参考

@@@code

firewall-cmd --zone=public --add-port=3410-3420/tcp --permanent

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --zone=public --add-port=5880/udp --permanent

firewall-cmd --zone=public --add-port=5881/tcp --permanent

firewall-cmd --zone=public --add-port=5000-5005/tcp --permanent

firewall-cmd --zone=public --add-port=7200/tcp --permanent

firewall-cmd --zone=public --add-port=6379/tcp --permanent

firewall-cmd –reload

firewall-cmd --permanent --list-port

@@#

posted @ 2019-08-07 15:31 秦秋随 views(...) comments(...) edit 收藏

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网