In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
/ / basic requirements for using docker
[root@localhost] # uname-r3.10.0-693.el7.x86_64
The kernel version must be above 3.10.
First, install dockers
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.
Docker's official website
Https://www.docker.com/
1, official download from Docker
Https://www.docker.com/
2. Method 1 of installing docker on the official website
[root@localhost ~] # vim / etc/yum.repos.d/docke-ce.repo// write yum source [docker-ce] name=docker-cebaseurl= https://download.docker.com/linux/centos/7/x86_64/stable/Packages/gpgcheck=0enabled=1[root@localhost ~] # yum repolist// View warehouse status [root@localhost ~] # vim / etc/yum.repos.d/docke-ce.repo// modify yum source [docker-ce] name=docker-cebaseurl= https://download.docker. Com/linux/centos/7/x86_64/stable/gpgcheck=0enabled= 1 [root @ localhost ~] # yum repolist// View warehouse status [root@localhost ~] # yum-y install docker-ce// download the latest version by default Time is slow, usually do not use this
Because of the network speed, we can generally take another method to download from our country. Many domestic websites provide docker-ce mirrors, such as Aliyun, NetEyun, Tsinghua University Mirror Station, and so on. Here we download it from Aliyun.
two。 Aliyun download method 2
[root@localhost ~] # rm-rf / etc/yum.repos.d/docke-ce.repo// Delete the yum source just now
Enter Ali mirror station
Https://developer.aliyun.com/mirror
[root@localhost ~] # yum install-y yum-utils device-mapper-persistent-data lvm2 [root@localhost ~] # yum-config-manager-- add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo[root@localhost ~] # ls / etc/yum.repos.d/// View yum Source
[root@localhost ~] # yum repolist// View Warehouse status
[root@localhost ~] # yum makecache// for yum cache, speed up [root@localhost ~] # yum list docker-ce.x86_64-- showduplicates | sort-rAccord / check the available version of docker
/ / here we download the specified version 18.9.0. Note that we did not take the method officially recommended by Aliyun. We downloaded docker-ce,docker-ce-cli and containerd.io respectively.
[root@localhost ~] # yum-y install docker-ce-18.09.0-3.el7 docker-ce-cli-18.09.0-3.el7 tainerd.io-1.2.0-el7// installs docker-ce,docker-ce-cli and containerd.io
3. After installation is complete
[root@localhost ~] # systemctl start docker// enable docker [root@localhost ~] # systemctl enable docker//docker join boot self [root@localhost ~] # docker-vDocker version 18.09.0, build 4d60db4// check whether the docker version is the specified version
[root@localhost ~] # docker version// View docker version information
If the installation is minimized, install a tab command to complete the basic concepts of [root@localhost ~] # yum-y install bash- complete II, Docker
Image: mirroring
Container: container
Repostry: warehouse
The image is the cornerstone of the container operation, and the container is the instance after the image is run.
[root@localhost ~] # docker pull centos:7// downloads a centos7 image. It is not recommended if it is very slow.
1, set acceleration
The browser opens the accelerated website: Douke Cloud https://www.daocloud.io/
/ / use the docker image accelerator, here is the daocloud accelerator, of course, there are other accelerators, for example
Such as Ali Yun, Tsinghua Mirror Station and so on.
[root@localhost ~] # curl-sSL https://get.daocloud.io/daotools/set_mirror.sh | sh-s http://f1361db2.m.daocloud.io
[root@localhost ~] # systemctl daemon-reload// daemon [root@localhost ~] # systemctl restart docker// restart docker [root@localhost ~] # docker info// to view docker details
[root@localhost ~] # cat / etc/docker/daemon.json {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]}// are key-value pairs
[root@localhost ~] # docker pull centos:7// download centos7 again
[root@localhost ~] # docker images// to check what are the local images
2. Change the image acceleration website to Aliyun
Https://www.aliyun.com/product/acr?spm=5176.12825654.eofdhaal5.42.366f2c4axwzdLK&aly_as=kt8HE3oy
[root@localhost ~] # cat / etc/docker/daemon.json {"registry-mirrors": ["http://f1361db2.m.daocloud.io"]}// replaces the https://x7bv0r2q.mirror.aliyuncs.com just copied and replaces the one above
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@docker ~] # systemctl daemon-reload [root@docker ~] # systemctl restart docker [root@docker ~] # docker pull centosUsing default tag: latestlatest: Pulling from library/centos
3. Change the mirror acceleration website to the one of Tsinghua University
Tsinghua University Mirror Station website: https://mirrors.tuna.tsinghua.edu.cn/
Test: download a nginx
[root@localhost ~] # docker pull nginx
[root@localhost ~] # docker images// to check what are the local images
[root@localhost ~] # docker run-itd-p 80 nginx// execute several times, run multiple nginx [root@localhost ~] # docker ps// to view the docker service
Browser testing
Open source project: born in 2013, an amateur project of dotcloud, implemented in Go. -the company changed its name to docker
Container: the goal is to implement a lightweight operating system virtualization solution. So that the user does not need to care about the management of the container, making the operation easier.
The differences between docker and virtual machines and traditional virtualization:
Traditional virtual machines: virtualize the hardware and then create / install the operating system.
Docker: virtualization at the operating system level, directly using the operating system of the local host.
Why use docker
1. Compared with traditional virtualization, it has many advantages:
The container is started in seconds.
Bforce docker has high utilization of system resources. A host can run thousands of docker containers at the same time.
CForce Docker basically consumes no system resources, which makes the performance of applications running in docker very high.
2, other advantages:
A, faster payment and deployment: developers can use a standard image to build a set of development containers, and after development is complete, operators can directly use this easy to deploy code
B, more advanced virtualization, the operation of the docker container does not need additional support, it is kernel-level virtualization, so it can achieve higher performance
C, easier migration and expansion: docker can run on almost any platform, such as physical machines, virtual machines, public clouds, private clouds, personal computers, servers, etc.
D, easier management: using docker can replace a lot of previous update work with simple modifications. All changes are distributed and updated incrementally, resulting in automated and efficient management.
Basic concepts in docker:
Images: a read-only template from which to create a docker container
Container (container): an instance created and run using an image. You can simply think of the container as a simplified version of the operating system. (it can be thought of as the operating system because it contains root user rights, process space and cyberspace, as well as applications running in it.)
Repository: a place where image files are stored centrally. It is divided into public warehouse and private warehouse.
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.