dotnet core in centos7 the docker deployment

-Y Docker the install yum
# if you want to install the docker-ce reference  https://docs.docker.com/install/linux/docker-ce/centos/ 
systemctl start docker
systemctl stop firewalld.service ## off the firewall
systemctl enable docker
systemctl disable firewalld.service
 
#pkill docker
iptables -t nat -F
ifconfig docker0 down
brctl delbr docker0
 
# If you want to compile dotnet core you need to install in linux
sudo yum update
sudo yum install dotnet-sdk-2.2
 
 
#new folder
mikdir -p /usr/app/dotnetsample
# In the next window or linux release, and to publish the next copying / usr / app / dotnetsample
dotnet publish -c Release -o /usr/app/dotnetsample/publish
 
# In / usr / app / dotnetsample New Dockerfile file, as follows
 
FROM microsoft/dotnet
WORKDIR /app
copy ./publish .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]

#At last
docker run -d --restart always  -p 5000:80 -e "ASPNETCORE_URLS= http://+:80" dotnetsample

Guess you like

Origin www.cnblogs.com/yangzn/p/11426240.html