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
上一篇:Android:指定分辨率和清晰度的图片压缩方法源码


下一篇:Termux 安装 Kali Nethunter