Article Directory
Docker overview
What is Docker
- Is a lightweight "virtual machine"
- Open source tools for running applications in Linux containers
The difference between Docker and virtual machine
virtual machine | container | |
---|---|---|
Start Time | slow | fast |
capacity | Big | small |
system | Logical isolation | Depends on the kernel (shared) |
Safety | Strong | weak |
Docker usage scenarios
- Packaged applications simplify deployment
- Can be freely migrated away from the underlying hardware
- Example: server migration from Tencent Cloud to Alibaba Cloud
Douker's core concept and installation method
Docker core concepts
Mirror image
A read-only module for Docker container engine
container
Create a running instance from the image
warehouse
Where to centrally save the image
Example: upload and download a certain service
Two ways to install Docker on CentOS
Use CURL to get Docker installation script to install
Use YUM warehouse to install Docker
Install Docker
1. Install dependent packages
[root@localhost ~] # yum install -y yum-utils device-mappeer-persistent-data lvm2
2. Set up Alibaba Cloud image source
[root@localhost /etc/yum.repos.d] # yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3. Install Docker-CE
[root@localhost /etc/yum.repos.d] # yum install -y docker-ce
systemctl start docker
systemctl status docker
systemctl enable docker
There is an additional bridge network card docker0
to explain the bridge network card
Docker image operation
Search mirror
docker search keyword
Get mirror
docker pull warehouse name[:label]
View mirror
docker images warehouse name[:label]
docker inspect image ID number
Add new label
docker tag name[:label]new name[:new label]
Delete mirror
docker rmi warehouse name[:tag]
or
docker rmi image ID number
At this point, the installation is over. You can download a service mirror from the shared warehouse at will. The above nginx is downloaded from the shared warehouse.