编程知识 cdmana.com

Installation and introduction of cloud native docker container [docker deployment of Web Applications & cloud native cornerstone]


One . Preface

1.1Docker What is it? ?

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for

Docker It's an application package 、 distribution 、 Deployed tools . It is basically a lightweight virtual machine . There are only things we need in the virtual machine , Other superfluous things are necessary . Let's look at the picture below , Take a look at the comparison between it and a normal virtual machine : as follows : Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_docker_02

1.2 pack 、 distribution 、 Deployment concept understanding

pack : The compilation environment required for software development , rely on , Third party libraries , Pack them together , Make a bag . distribution : You can put “” package ” Upload image warehouse , Others can easily access and install , Improved efficiency . Deploy : No matter what operating system , As long as there is “ package ”, You can run it with a simple command , Automatically simulate the same environment , Very convenient .

1.3 advantage / solve the problem

Think of a thing , Before, when I was taking on outsourcing projects , Because it's taking over other people's projects , Because of the environment , It took more than ten days to run successfully , And after the development , Redeployment to the server is also a very serious problem , So that it can't be solved now bug. It's a headache, isn't it , If we adopt Docker Development and deployment . This problem doesn't exist .

advantage : It ensures that the running environment on different machines is consistent , Will not appear on my machine, running normally , You have problems when the machine runs .

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ restart _03 Important concepts : Mirror image 、 Containers

Mirror image : Similar to software installation package , It can be quickly spread and installed . Containers : Status after software installation , Each software running environment is independent 、 Segregated , It's called a container .

Two . install Docker

2.1 install

We click on the link below , Enter the official , Download and install :

 ​ https://www.docker.com/products/docker-desktop ​

Choose the appropriate version of the direct computer to install ->

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_docker_04

Here is the installed desktop version . When the download is complete , Open the installation :

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_docker_05

Once installed , One thing to note : You need to restart your computer after installation , Remember to save the file , I forgot to save and was forced to restart .

2.2 Error reporting solution :

If you encounter the following errors , Please go to my home page to search for keywords to read this article to solve the problem : The first mistake :

WSL 2 installation is incomplete.

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_docker_06

The second mistake :

System.InvalidOperationException: Failed to set version to docker-desktop: exit code: -1

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for _07

Search for keywords on my home page to read this article :

      
      
WSL 2 installation is incomplete. 【BUG solve 】【Docker Original cornerstone of cloud 】
  • 1.

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for _08

Click in to read , The above two errors can be solved .

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for _09

3、 ... and , Set domestic image source

3.1 Domestic image source address

<table> <thead> <tr> <th> Image accelerator </th> <th> Mirror accelerator address </th> </tr> </thead> <tbody> <tr> <td>Docker The official image of China </td> <td>https://registry.docker-cn.com</td> </tr> <tr> <td>DaoCloud Mirror station </td> <td>http://f1361db2.m.daocloud.io</td> </tr> <tr> <td>Azure China mirror </td> <td>https://dockerhub.azk8s.cn</td> </tr> <tr> <td> Mirror station of HKUST </td> <td>https://docker.mirrors.ustc.edu.cn</td> </tr> <tr> <td> Alibaba cloud </td> <td>https://<your_code>.mirror.aliyuncs.com</td> </tr> <tr> <td> Qiniuyun </td> <td>https://reg-mirror.qiniu.com</td> </tr> <tr> <td> Netease cloud </td> <td>https://hub-mirror.c.163.com</td> </tr> <tr> <td> Tencent cloud </td> <td>https://mirror.ccs.tencentyun.com</td> </tr> </tbody> </table>

3.2 Image acceleration configuration mode

After solving the above BUG after , We successfully opened Docker( Here's the picture ), We click settings :

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ restart _10 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for _11

Replace the following code block with the box above .

      
      
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": true
},
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/",
"https://1rlt72n0.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://reg-mirror.qiniu.com",
"https://dockerhub.azk8s.cn",
"https://mirror.ccs.tencentyun.com"
]
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.

Click here to restart the application .

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_docker_12

Four , ending

Here we are. , our Docker The deployment installation has been completed , In the next section we will record , How to use Docker Quick installation of software !

 Cloud primordial Docker Vessel installation and entry 【Docker Deploy web application && Cloud primary cornerstone 】_ Search for _13

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://cdmana.com/2022/174/202206231833089303.html

Scroll to Top