Docker simple release dotnet core project

Original: https://www.cnblogs.com/chuankang/p/9474591.html

 

 


docker release dotnet core simple process

 

 

Shining steps to the basic right but there are a few places to note:

   vs2019 created based on the .net core 2.2 project, Dockerfile want to move the file to the root directory for solution

  docker download a lot of time slow death do not know whether to buy a server problem

  Download center is also equipped with a docker or something for nothing with no acceleration feeling to write up, and then add the following

 

 

 

 

Specific steps:

 

1、安装docker
  sudo yum install docker

 

2、启动docker
  systemctl start docker.service

 

3, configure the boot
  systemctl enable docker.service

 

4, view the version information docker
  docker version

 

5, vs2019 created based on the .net core items 2.2
  and then create Dockerfile
  steps:
  On the Right Project => Add => Docker support
  will be in the project directory with a raw file Dockerfile (Note: This file without extension)
  This file Once it's created, he moved to the root of the solution (and project folders at the same level directory)

 

6, upload the entire solution to the linux system on
  my environment:
  the local computer: win7 64 Wei
  VS2019
  server environment: CentOS 7.6 64 bit (Tencent)


  Create a folder on Linux:
  Download: http: //www.zdfans. com / html / 31043.html
  Baidu network disk (key: w2lv): https: //pan.baidu.com/s/1EI3ADscMDQhxJlCgGD5YDA

  with Xshell6, log on linux server with webshell way will do.
  IP addresses are logged to the public network IP, the other will generally look at the interface should be, mainly because I forgot.
  I created in / home following a directory website, path: / home / website /

  command:
  cd /
  LS
  cd Home
  mkdir Website
  LS


  on the windows, upload files to linux:
  Original: https: //blog.csdn.net/sgmcumt / Article This article was / the Details / 79,135,395

  1, download the software. Address: https: //www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  2, the mounting position (I environment is win7 64 bit): C: \ Program Files \ the PuTTY
  . 3, run cmd (Start menu to select or windows logo key + R),
    Input: cd C: \ Program Files \ PuTTY
  4, upload a directory
    pscp -re: / WebApplication5 [email protected]: / home / website


  Check the file system in linux if Uploaded:
  In Xshell6, enter the following command:
  cd / Home / Website / WebApplication5
  LS



7, in linux, execute the command to generate a mirror.
  1, enter the directory WebApplication5
    cd / Home / Website / WebApplication5

  2, execute the command
    sudo docker build -t demo-netcore.
    Note: There is one final after the space. ""
    This statement is the last character "dot" Do not have missed ! !

 

8, view the generated image
  generated before the image name is: demo-netcore
  command:
  sudo Docker ImagesRF Royalty Free


9, the container docker run
  sudo docker run --name democore -d -p 54907 : 80 demo-netcore

 

10, external network access
  because time was running docker container port mapping so external access port is 54907
  , such as my visit is this address: http: //106.54.92.81: 54907 /

 

 

Some screenshots:

 

 

 

 

 

 

 

I Tencent server system installed, and then try again down the process

 

Guess you like

Origin www.cnblogs.com/guxingy/p/12071952.html