Write in front:
Hello, everyone! Last time we looked at getting started with Docker
Today will talk about the installation of Docker, the next is Docker common commands, etc., continue to update, please look forward to!
Mind mapping:
1. Introduction to Docker version;
Docker is divided into community CE and enterprise EE after version 1.13. The Community edition is free for individual developers and small groups, while the Enterprise edition offers additional services such as infrastructure, containers, plug-ins, and more that have been officially tested and approved. The community edition is enough for us. So we installed the community edition;
2. Tool preparation;
First of all, we can follow the official document to install:
Docker official installation document
Virtual machine VMware, system CentOS7 and connection tool FinalShell, here you can see my other article –
3, Docker installation steps;
After connecting with FinalShell,
-
Switch to user root:
-
Docker requires a CentOS kernel version higher than 3.10. Check the prerequisites on this page to verify whether your CentOS version supports Docker.
Command: uname -r
-
Log in to Centos as user root. Make sure the yum package is up to date:
Command: yum update
Here you need to wait a little bit ~ (press Y halfway)
-
Install the required package, yum-util provides yum-config-manager functionality, the other two are devicemapper driver dependent;
Lvm2 command: yum install -y yum-utils device-mapper-persistent-data lvm2
Waiting for the installation to succeed:
-
Configure the yum source:
Command: yum – config manager – add – ‘https://download.docker.com/linux/centos/docker-ce.repo
-
Install the latest version of Docker:
Yum install docker-ce docker-ce-cli containerd. IO
Here you need to wait a little bit ~ (press Y halfway)
-
Start Docker and set boot up
Command: systemctl start docker, systemctl enable docker
-
Verify the Docker
Command: docker version
-
The HelloWorld tests;
Command: docker run hello-world
Let’s run the above command again:
Run successfully!
4, HelloWorld operation principle analysis;
Let’s take a look at the previous Docker schematic:
From left to right client, Docker runs host, remote warehouse;
Docker build,pull, and run commands respectively;
In the middle Docker host Docker Daemon main running thread and Containers, Containers can run many instances, (instances are instantiated from Images on the right) Images are stored locally image files, such as Redis, Tomat image files;
On the right side is Registry mirror warehouse, default remote mirror warehouse https://hub.docker.com/ is only a foreign host, download is slow, unstable, so the back to configure ali cloud warehouse mirror address, stable and fast;
Docker run helloworld docker run helloworld
Ok, today is the first to share here, next time to continue to bring you Docker installation and use the command follow-up content! More dry goods, quality articles, welcome to pay attention to my original technology public number ~
This article is formatted using MDNICE