Docker novice and experience in nginx deployment in Docker

To be honest, I had the impression that for Docker is not very good, I feel this is a fashionable technique, and before long the heat will last. But this semester the introduction of an enterprise-class server lesson content on Docker talked about, but now Solo also strongly recommended Docker deployment, so I do not know feel a little knowledge about it does not seem appropriate. So I learned some relevant content, and do some simple practices.

First of all, I only know the beginning Docker is to isolate different software running in different containers, but do not know what is the meaning of this. I think from our point of view the use of personal computers run, run different software in the operating system and no problem ah, even I aliyun (regarded as a server) in site deployment, as well as a bunch of software installed directly in an operating system, running very normal, why should specially fitted to Docker inside isolate, is simply baffling thing. After the enterprise server deployment history teacher talked about the development of enterprise applications, and finally understand the meaning of Docker. The teacher said in class the first time in the enterprise application server deployment and operation of personal computer applications are similar with a lot of software run on an operating system. But later it was found that this is very unsafe, but a hacked up one of the software, he may be starting to get permission from the entire operating system software, which controls all the software on the server. And all run on a single operating system for the allocation of resources is also a problem, there may be a trivial program takes up too many resources, resulting in another important program can not run. In addition, a program may lead to the collapse of the whole computer crash, which affects other programs. So it was a virtualization technology, VMware is the most typical example, it enables multiple virtual operating systems to run simultaneously on a computer, an operating system to run only one program, thus greatly improving the security, even if the break a software can only get to that a virtual operating system permissions, and can easily manage different operating systems to allocate the resource size, even if a virtual machine crash does not affect other virtual machines. But this technology is also a problem, is to run a program you need to install an entire operating system, and the operating system itself will take up a lot of resources, thus causing a lot of waste of resources. So it appeared Docker this technology, which is the container of the technology. Docker is not my understanding of the whole, I try to say something, if you have questions please point it out. Docker itself acts as the operating environment of the application, running on top of each container Docker, these containers between each application of a special mechanism to achieve a high level of isolation, even the collapse of a container, it will not affect other containers. At the same time there is no need to run a complete operating system, virtual machine, and it saves a lot of resources in comparison. Further, Docker application is installed by a special That way mirror installation, be able to do out of the box, do not need to focus on all kinds of messy configuration, which means that as long as the development machine Docker in the mirror can run successfully, change to another machine in Docker will be able to successful operation, and not because jdk version or versions that rely on database problems caused not run. This concept is somewhat similar ads Java virtual machine, the "compile once, run anywhere", but it did a higher level than the Java virtual machine, any application as long as the language development of Docker packed into a mirror can run everywhere.

Here to talk about how to install and deploy a Docker nginx program.

Start with Windows systems. If you are using previous versions of Win10 or Win10 etc. Home Edition does not support the version of Hyper-V, you will need to use Docker by Docker Toolbox, Download: https://github.com/docker/toolbox/releases . If Win10 Professional Edition and above, it can be downloaded directly Docker Desktop, Download: https://hub.docker.com/?overlay=onboarding . After the installation is complete, the desktop will Docker download icon appears, and then double-click, double-click the here does not have the pop-up window, but in the lower right corner of the tray icon which will have a Docker is starting icon appears. Wait until splats become Docker is running on behalf of the startup is complete. But docker Windows environment is not tricky, it may be stuck in starting not move.

Come talk about the Linux system. By yum install dockercommand can be installed directly Docker, very convenient. After installation input service docker startcan make Docker up and running.

After the installation is complete, you can try to deploy a nginx up. Open the console input docker run -d --name mynginx -p 80:80 nginx. The meaning of this parameter which are: representatives run run; -d representatives running in the background, that does not output mutual information; - name that represents the new vessel's name, mynginx is the name ;-p container vessel on behalf of their own and take the local port mapping, wherein the former 80 is a port of the machine 80, a post 80 is a container; finally nginx nginx image representative of the image library Docker central plane. Actually, the normal method is to first use docker pull nginxthe command first and then run locally mirrored pulled, but it will automatically direct run to pull down. If the machine is deployed, open your browser and enter 127.0.0.1 nginx can see the initial page, if it is deployed in the cloud server, then enter the IP address or domain name on the line.

Guess you like

Origin www.cnblogs.com/aopstudio/p/11919279.html