preface
Windows10 64-Bit professional version can only use docker Centos installation can refer to, based on the completion of the installation of Centos for today’s Docker installation
Docker learning (I) Environment Ready to install centos7
Environment to prepare
- Install the Docker persistence package and yum toolkit
yum install -y yum-utils device-mapper-persistent-data lvm2
- Yum -utils a tool kit for simplifying yum installation. Optional
- Lvm2: Device -mapper- Persistent-data lvm2: Does lvm2 install docker datastory drivers
- Modify the image installation source to Ali cloud acceleration, the default is foreign download is slow
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Yum automatically selects the fastest installation sourceyum makecache fast
Install the docker
Docker-related commands will be covered in more detail in a future article
- It takes 1-2 minutes to install the open source zonal version of Docker, depending on the speed of the network
yum -y install docker-ce
- Start the docker
service docker start
- Check the Docker version, which is divided into two parts: client information and server information
docker version
- Download the Hello-Word image
docker pull hello-word
- Run the hello – word
docker run hello-word
If the following information is displayed, the operation is successful
Hello from Docker!
This message shows that your installation appears to be working correctly.
Copy the code
Problems encountered
Q: Docker pull hello-word failed
A: Because Docker is connected to A foreign server by default, the download may fail. You can use Aliyun image acceleration agent
Ali Cloud Docker image acceleration
Image acceleration service
The background address of acceleration can be seen only after login. The acceleration address of each user is a different copy-related acceleration script, which can be accelerated by running in centos
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://ki61hxwi.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Copy the code
Write in the last
Relevant articles will be published on the public account, you can follow the public account ALBk, after attention, you can get a lot of learning videos
We hope that you who love technology can come together to communicate, get the latest information and learning resources, you can follow the public account ALBk, personal blog!