CentOS7.9 docker 部署 NET5 程序
2021/5/25 7:28:53
本文主要是介绍CentOS7.9 docker 部署 NET5 程序,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
安装:wget
yum -y install wget wget --version
安装dnf
wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/dnf-conf-0.6.4-2.sdl7.noarch.rpm wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64//dnf-0.6.4-2.sdl7.noarch.rpm wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/python-dnf-0.6.4-2.sdl7.noarch.rpm yum install python-dnf-0.6.4-2.sdl7.noarch.rpm dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm yum -y install dnf dnf --version
安装 NET5 sdk 和 runtime
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm sudo dnf -y install aspnetcore-runtime-5.0 dotnet --info sudo dnf -y install dotnet-sdk-5.0 dotnet --version dotnet --list-runtimes
安装Docker
参照文章: https://blog.csdn.net/csethcrm/article/details/117220487
发布程序
// 程序所在目录 /root/web cd /root/web 上传待发布的程序:https://download.csdn.net/download/CsethCRM/19025593 docker build -f /root/web/Dockerfile -t net5demo . docker run --name ctn_net5demo -d -p 8080:80 net5demo docker logs [容器名/容器ID] curl http://localhost:8080 出现网页内容则代表成功.
Nginx 安装
参照文章:https://blog.csdn.net/csethcrm/article/details/116274296
这篇关于CentOS7.9 docker 部署 NET5 程序的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-28duckdns docker
- 2024-03-21docker add host
- 2024-03-14denied: requested access to the resource is denied docker push
- 2024-03-07docker graylog
- 2024-03-05Docker容器实战(00)-基础命令大全
- 2024-03-01dockerd-entrypoint.sh
- 2024-02-23linux mint install docker
- 2024-01-18angular docker
- 2024-01-10优雅而强力地卸载docker-desktop
- 2024-01-09完蛋,我被挖矿木马包围了|使用 TLS 连接 Docker