Linux version: CentOS7
1. Install Docker:yum -y install docker-io
2. Install Dontnetcore Image: Docker pull Microsoft/dotnet
If there is an error NET/HTTP:TLS handshake timeout Installation Timeout, the description is not accessible Docker.hub
Workaround add a domestic mirror address:
Vim/etc/sysconfig/docker Open the Docker configuration file,
Append--registry-mirror=http://abcd1234.m.daocloud.io to Options
so: options= "XXX--registry-mirror=http://abcd1234.m.daocloud.io"
then Restart the Docker service in effect: systemctl Restart Docker.service && systemctl restart Docker
Re-execute the installation command
3. Perform Docker run-it microsoft/dotnet into the mirror, dotnet--version View the core version, enter Exit to exit.
4.vs publish the file and use the remote tool to upload the publish file to the server.
5. Write Dockerfile (a configuration file that automatically builds a mirror),
From Microsoft/dotnetworkdir/appcopy./test. entrypoint ["Dotnet", "Dockertest.dll"]
Current directory Conditions
Test for the published file directory
6. In the Dockerfile directory, perform the Docker build-t dockertest. (note contains.) ), build a dockertest container that contains all the content of the Web program.
7. Run the container docker run-p 80:80-e "aspnetcore_urls=http://+:80" dockertest.
You can now access the Web application in the browser.
Record the first simple deployment of the Asp.netcore program onto Docker