Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Overview of docker & fancy installation

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Docker Overview:

What is Docker?

Docker is a Linux container technology, an efficient, agile, and lightweight container solution that supports deployment on a variety of mainstream platforms (PaaS) and locally. Docker is a cloud kai source project based on GE language, which was born in 2013. It was originally initiated by DotCloud, later renamed as DockerInc, and then focused on kai distribution of Docker-related technologies and products. The Docker project has joined the Linux Foundation, following the Apache2.0kai source agreement, and all kai source dai codes are maintained on https://github.com/docker. The official website is: https://www.docker.com/, has relevant documents to refer to. Now docker and openstack are the most popular cloud computing kai source projects.

Docker's Logo is designed as a blue whale, towing many containers. The idea of docker is to achieve "Build,ShipandRunAnyApp,Anywhere", that is, to manage the life cycle of Packaging, Distribution, Deployment and Runtime of the application, so as to achieve the goal of "encapsulating once, running everywhere". The application components here can be a Web application, a compiler environment, a set of database platform services, or even an operating system or cluster. Based on several kai source technologies on the Linux platform, Docker provides efficient, agile and lightweight container solutions and supports deployment to local environments and multiple mainstream cloud platforms. It can be said that Docker provides a "one-stop" practical solution for the kai sending, running and deployment of applications for the first time.

Why use docker?

Benefits of virtualization of Docker containers

The sponsor of the Docker project and CTOSolomonHykes of Docker once believed that Docker conformed to the right trend at the right place and at the right time-- how to build the application correctly. Applications created by dai,kai publishers in the cloud must be easily spread over the network, that is, applications must be free from the limitations of the underlying physical hardware, and must be accessible "anytime, anywhere". Therefore, kai issuers need a new way to create distributed applications, rapid distribution and deployment, which is the biggest advantage that Docker can provide. As a simple example, suppose a user tries to build a website based on the most common combination of LAMP (Linux+Apache+MySQL+PHP). According to the traditional practice, first, you need to install Apache, MySQL and PHP and the environment on which they operate; then configure them separately (including creating appropriate users, configuration parameters, etc.); after a large number of operations, you also need to conduct functional tests to see if they are working properly; if not, debug tracking means more time dai price and uncontrollable risks. As you can imagine, if the number of applications increases, things will become more difficult to deal with. What's even more frightening is that once a server migration is required (for example, from Amazon cloud to another cloud), each application often needs to be redeployed and debugged. These trivial and boring "manual work" greatly reduces work efficiency. The root cause is that these applications run directly on the underlying operating system, and there is no guarantee that the same application behaves consistently in different environments. Docker, on the other hand, provides a smarter way to package applications through containers and decouple applications and running platforms. This means that when migrating, you only need to start the required containers on the new server, regardless of whether the old and new servers are the same type of platform. This will undoubtedly save a lot of valuable time and reduce the risk of problems with the deployment process.

2 the advantages of Magi Docker in kai sending and operation and maintenance:

Faster delivery and deployment: Docker,kai dispatchers can use images to quickly build a standard kai sending environment; after kai sending is completed, testers and OPS personnel can directly use the same environment to deploy Dai codes. As long as kai sends out the tested dai code, you can ensure that it runs seamlessly in the production environment. Docker can quickly create and delete containers, achieve rapid iteration of dai, and save a lot of time for kai to send, test and deploy. Moreover, the whole process is visible, making it easier for the team to understand the application creation and work process. More efficient resource utilization: the operation of the Docker container does not require the support of additional virtualization hypervisors (VirtualMachineManager,VMM, and Hypervisor). It is kernel-level virtualization that achieves higher performance with low additional requirements for resources. Compared with the traditional virtual machine, it is one or two orders of magnitude higher. Easier migration and expansion: Docker containers can run on almost any platform, including physical machines, virtual machines, public clouds, private clouds, personal computers, servers, etc., while supporting mainstream operating system distributions. This compatibility allows users to easily migrate applications between different platforms. Simpler update management: with Dockerfile, you can do a lot of previous updates for dai with only minor configuration changes. And all changes are distributed and updated incrementally, resulting in automated and efficient container management.

3 compare Docker with virtual machine:

As a lightweight virtualization method, Docker has a significant advantage over traditional virtual machines in running applications:

The Docker container is fast, and startup and stop can be achieved in seconds, while the traditional virtual machine approach takes minutes.

Docker containers require few system resources, and thousands of Docker containers can be run simultaneously on a single host (10K container instances have been implemented on IBM servers).

Docker makes it easy for users to obtain, distribute and update application images, store reuse, and update incrementally through operations similar to Git design concepts.

Docker supports flexible automated creation and deployment mechanisms through Dockerfile to improve productivity and standardize processes.

In addition to running the application, the Docker container basically does not consume additional system resources, which ensures the application performance while minimizing the system kai pin. The traditional virtual machine way to run N different applications requires N virtual machines (each virtual machine needs to allocate exclusive memory, disks and other resources separately), while Docker only needs to launch N isolated "very thin" containers and put the application into the container. The performance of the application is close to the native performance.

Of course, in terms of isolation, the traditional virtual machine approach provides relatively closed isolation. But this does not mean that Docker is not safe. Docker uses a variety of protection technologies on the Linux system to achieve strict isolation reliability, and can integrate many security tools. Since version 1.3.0 of kai, Docker has focused on improving the security control of containers and the security mechanism of images, which greatly improves the security of using Docker. In the known large-scale applications, there are no security risks to worry about at present.

Characteristic comparison between Docker Container Technology and traditional Virtual Machine Technology

The reason why Docker virtualization has many advantages is inseparable from the design and implementation of operating system virtualization technology.

The traditional way is to achieve virtualization at the hardware level, which requires additional virtual machine management applications and virtual machine operating system layers. The Docker container is virtualized at the operating system level, directly reusing the operating system of the local host, so it is more lightweight. Docker installation:

Docker official website: https://www.docker.com/

Docker official document: https://docs.docker.com/

Docker's noteworthy features:

File system isolation: each process container runs in a completely separate root file system.

Resource isolation: system resources, such as CPU and memory, can be allocated to different containers using cgroup. Network isolation: each process container runs in its own cyberspace, virtual interface and IP address.

Logging: Docker will collect and record the standard stream (stdout/stderr/stdin) of each process container for real-time or batch retrieval.

Change management: changes to the container file system can be committed to a new image and reused to create more containers. There is no need to use templates or manual configuration.

Interactive shell:Docker can assign a virtual terminal and associate it to the standard input of any container

Before installing docker, one more point, docker now has two versions, one is called docker-EE Enterprise Edition, the other is called docker-CE Community Edition, free version, in fact, the two versions do not have much deviation, the difference is that docker company will provide follow-up official technical support and other services, for us, we must use the community to do more, we can use the learning community to do.

Requirements for installing docker kernel version: 3.10 or above

If it is the centos6 version, because the default kernel version of centos6 is 2.6, if you want to install docker, you can upgrade the kernel.

(1) official installation: (we are in a test environment, so ce is installed)

[root@sqm-docker01 yum.repos.d] # pwd/etc/yum.repos.d

[root@sqm-docker01 yum.repos.d] # vim dockerce.repo

[dockerce] / / Warehouse category

Name=dockerce / / Warehouse name (description)

Baseurl= https://download.docker.com/linux/centos/7/x86_64/stable/ URL access path

Enabled=1 / / enable this software repository

Gpgcheck=0 / / verify (check) the signature of the package. 0 means no check, 1 means check.

[root@sqm-docker01 yum.repos.d] # yum repolist

/ / View the configured yum repository

/ / install docekr-ce [root@sqm-docker01 yum.repos.d] # yum-y install docker-ce

# # or download the docker-ce.repo file directly:

[root@k8s-master ~] # cd / etc/yum.repos.d/

[root@k8s-master yum.repos.d] # wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

[root@k8s-master yum.repos.d] # yum repolist

[root@k8s-master yum.repos.d] # yum-y install docker-ce

[root@k8s-master yum.repos.d] # docker-v

(2) download docker-ce from domestic Ali Yun source:

(1) you can write a custom yum repository:

Alibaba open source mirror station: https://opsx.alibaba.com/mirror

# find docker-ce

URL: https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/

Yum Warehouse content:

(2) or download Ali's repo source directly:

Download the file locally using the wget tool:

[root@sqm-docker01 yum.repos.d] # wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

View the available versions of docker-ce:

[root@sqm-docker01 yum.repos.d] # yum install-y docker-ce-18.09.0-3.el7 docker-ce-cli-18.09.0-3.el7 containerd.io-1.2.0-3.el7

Download the specified version:

[root@sqm-docker01 yum.repos.d] # yum install-y docker-ce-18.09.0-3.el7 docker-ce-cli-18.09.0-3.el7 containerd.io-1.2.0-3.el7

The above three installation packages are: install the community version to provide the docker client to provide the running environment

After installing the startup docker, add the following auto-boot:

[root@sqm-docker01 yum.repos.d] # systemctl start docker [root@sqm-docker01 yum.repos.d] # systemctl enable docker

View the running process of docker:

Optimization after installation:

(1) automatic completion of Docker command (minimizing the installation of the system needs to be installed, if it is installed graphically, it comes with command completion by default)

[root@docker01 ~] # yum-y install bash-completion [root@docker01 ~] # curl-L https://raw.githubusercontent.com/docker/compose/1.24.1/contrib/completion/bash/docker-compose-o / etc/bash_completion.d/docker-compose [root@docker01 ~] # source / etc/bash_completion.d/docker-compose

(2) docker configuration accelerator:

Dayun Accelerator website: https://www.daocloud.io/

After logging in, there will be a rocket icon. Click on it.

Restart the docker service when prompted:

[root@sunqiuming-1 ~] # systemctl daemon-reload # needs to reload the daemon

[root@sunqiuming-1 ~] # systemctl restart docker

After completing the operation of the accelerator, we will find that there is an extra file in / etc/.

[root@sunqiuming-1 ~] # cat / etc/docker/daemon.json {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]}

# that is to say, the sentence just now is to implement this file and add this URL. In fact, this URL can also be changed, and the accelerator is not only Daoyun, but also a company that also provides accelerator services, that is, the famous Aliyun.

Ali Yun official website: https://www.aliyun.com/

You can also change it to this URL, of course, if you change it, you need to execute the reload command to reload the configuration file.

[root@sunqiuming-1 ~] # systemctl daemon-reload [root@sunqiuming-1 ~] # systemctl restart docker

The above is basically the whole content of docker deployment, installation and optimization.

-this is the end of this article. Thank you for reading-

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report