系统相关
首页 > 系统相关> > CentOS7.9 docker 部署 NET5 程序

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

标签:sdl7,dnf,0.6,CentOS7.9,wget,docker,noarch,rpm,NET5
来源: https://blog.csdn.net/CsethCRM/article/details/117220143