In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
With the vigorous development of computers in recent years, a large number of excellent systems and software have been produced. Software developers are free to choose a variety of software applications. But at the same time, the problem is the need to maintain a very large development, test, and build environment. In the face of this situation, Docker container technology came out of nowhere, providing a very simple, flexible and efficient solution, no longer need to change the existing habits, can be used with existing tools. Therefore, mastering Docker is the only way to go through cloud computing.
1. Overview of Docker 1) introduction to Docker
Docker as the most popular project in the open source community, it is an open source tool to run applications in the Linux container, is a lightweight "virtual machine", all the source code of docker is maintained in https://github.com/docker, its official website is: https://www.docker.com.
The design purpose of Docker: through the management of the life cycle of application components, such as encapsulation, release, deployment, operation, etc., to achieve the purpose of packaging and running everywhere at the level of application components. The components here can be either an application, a set of services, or even a complete operating system.
2) the difference between Docker and virtual machine
As a lightweight virtualization scheme, Docker has significant advantages over traditional virtual machines.
Characteristic Docker container traditional virtual machine boot speed second minute computing power loss almost no loss about 50% performance is close to native weaker than system support (stand-alone) thousands of dozens of isolated resource limits are completely isolated
The reason why Docker has many advantages is inseparable from the characteristics of operating system virtualization. Traditional virtual machines require additional hypervisors and virtual operating system layers, while Docker containers are virtualized directly above the operating system level.
As shown in the figure:
3) usage scenarios of Docker
Now we need to be able to easily create applications running on the cloud platform, we must break away from the underlying hardware, and we also need to have access to these resources at any time and place, which is what Docker can provide.
Docker's container technology can easily create a lightweight, portable, self-sufficient container for any application on a single clause. Packaging applications through this container means simplifying the trivial repetitive work of redeploying and debugging, and greatly improving productivity.
For example, if the server is migrated from Tencent Cloud to Aliyun, if Docker container technology is used, you only need to start the required container on the new server.
2. The core concept of Docker 1) Image (Mirror)
An image is the basis for creating a docker container, and a docker image is similar to a virtual machine image and can be understood as a read-only module for the docker engine, including the file system.
Docker provides a simple mechanism to create and update existing applications, and users can download existing applications from the Internet to use them directly.
2) Container (container)
Containers run instances from applications created by images, and containers are isolated and invisible to each other. Think of the container as a simple version of the linux system environment (including root permissions, process space, user space and cyberspace, etc.), as well as application boxes packaged by applications running on this environment.
3) Repository (warehouse)
Docker repository is a place where images are stored centrally. After creating your own image, you can use the command to upload it to a public or private warehouse, so that the next time you want to use the image on another machine, just pull it from the warehouse!
The warehouse registration server is the place where the warehouse is stored, which contains multiple warehouses, each warehouse centrally stores a certain type of image, and uses different tags to distinguish them. Docker Hub, the largest public repository, stores a large number of images for users to download and use.
Third, install Docker
This time, we use CentOS version 7.5, and the installed Docker is version 18.09!
1) install the specified Docker version [root@docker ~] # systemctl stop firewalld & & setenforce switch to close the firewall and SELinux, if not It will hinder the normal startup of docker [root@docker ~] # yum install-y yum-utils device-mapper-persistent-data lvm2# to install docker depends on [root@docker ~] # yum-config-manager-- add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo# to obtain the repo configuration file of Aliyun's docker-ce [root@docker ~] # yum makecache # to establish yum metadata cache [root@docker ~] # yum repolist # lists the docker software packages available in the yum warehouse.. / / omit part of the content docker-ce-stable/x86_64 Docker CE Stable-x86 "646" confirm docker. There are available packages in this list, and what I show here is 65 (but it must not be 0) [root@docker ~] # yum list docker-ce.x86_64-- showduplicates#/ to view the available versions of docker Where stable is expressed as a stable version of [root@docker ~] # 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# needs to install docker-ce, docker-ce-cli, containerd.io these three tools # of which docker-ce, Docker-ce-cli needs to specify the version [root@docker ~] # systemctl daemon-reload [root@docker ~] # systemctl start docker# to start dockerroot @ docker ~] # docker- v # to view the version of docker-ce-cli Docker version 18.09.0 Build 4d60db4 [root@docker ~] # docker version # View docker details Client: Version: 18.09.0 API version: 1.39 Go version: go1.10.4 Git commit: 4d60db4 Built: Wed Nov 7 00:48:22 2018 OS/Arch: linux/amd64 Experimental: falseServer: Docker Engine-Community Engine: Version: 18.09.0 API version: 1.39 (minimum version 1.12) Go version: go1.10.4 Git commit: 4d60db4 Built: Wed Nov 7 00:19:08 2018 OS/Arch: linux/amd64 Experimental: false
If you are minimizing the installed docker, you need to execute the following command to support the automatic completion of the Docker command!
[root@docker ~] # yum-y install bash-completion / / supports automatic completion of docker command The following command can be downloaded without entering [root@docker~] # curl-L https://raw.githubusercontent.com/docker/compose/1.24.1/contrib/completion/bash/docker-compose-o / etc/bash_completion.d/docker-compose// to download the script file that supports automatic completion of the docker command [root@docker~] # source / etc/bash_completion.d/docker-compose//. After the script is executed, switching bash will take effect. 2) acceleration of docker image download
Use Aliyun's mirror accelerator!
[root@docker ~] # tee / etc/docker/daemon.json
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.