Server configuration: linux cenos 7.6 64 bit
Program: .net core 3.1 version
linux install docker
The first step: install on the new host for the first time Docker Engine- before the Community, need to set Docker warehouse sudo yum install -y yum- utils \ Device -mapper-persistent- the Data \ lvm2 Step two: sudo yum -config- Manager \ - -add- repo \ HTTPS: // download.docker.com/linux/centos/docker-ce.repo The third step: sudo yum install Docker -ce Docker-CE- cli containerd.io part IV: execution finished third gpg key will let you step to receive input: Y step five: sudo systemctl Start docker step Six: sudo docker the Hello RUN - world prompted docker successful installation! ! !
linux install .net core operating environment
1:sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm 2:sudo yum update sudo yum install dotnet-sdk-3.1
.net core to publish
Creating dockerfile control file, edit the files inside please use the following code, dockerfile will generate an error marked red version of his name and Solutions
FROM microsoft/dotnet:3.1-aspnetcore-runtime WORKDIR /app COPY . . EXPOSE 80 ENTRYPOINT ["dotnet", "netcore.dll"]
Use xftp upload the locally published net core files to linux
Create a docker perform mirroring under Linux and make it run container
linux输入:
cd /home/website/core1 docker build -t netcore1 .