Docker configures Huawei cloud images to accelerate the detailed deployment process

The software is introduced

Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image that can then be published on any popular Linux or Windows machine, and can also be virtualized. Containers are completely sandboxed, with no interfaces to each other

Supported operating systems

After strict measurement by Huawei Cloud, the following operating systems can fully run all Docker functions in Kunpeng Ecology:

  • CentOS 7.5
  • EulerOS 2.8
  • Ubuntu 18.04

Docker installation

CentOS operating system

  1. Prepare environment installation dependency packages

Run the following command to install dependency packages.

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Copy the code
  1. Perform the installation

Install using the software repository

  1. Old versions of Docker are named “Docker” or “Docker-Engine”. If these versions are installed, you need to uninstall them first.

Everything saved in /var/lib/docker/, including images, disks, and network configurations, remains.

sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate
Copy the code
  1. Configure the software repository.
 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Copy the code
  1. Install the docker – ce.
sudo yum install docker-ce docker-ce-cli containerd.io
Copy the code

This command will always install the latest version of docker-ce. If you need to install the specified version, see the following operations:

sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
Copy the code

Docker Image acceleration (Huawei Cloud implementation)

1. Log in to the Huawei Cloud website and register a Huawei cloud account

www.huaweicloud.com

2. Log in to the Huawei Cloud account and click the console in the upper right corner of the web page

3. Click service list in the upper left corner

4. Locate container Image Services in Container Services and click Container Image Services

5. Click the center of the image and add the image accelerator

6. Huawei Cloud official will give us a Huawei Cloud acceleration address

7. Finally, write the acceleration address to the Docker configuration file

Mirror to accelerate

cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
Copy the code
chmod 777 /etc/systemd/system/docker.service
Copy the code
vi /etc/systemd/system/docker.service
Copy the code

Change the line after ExecStart to –registry-mirror= Huawei Cloud accelerator url

ExecStart=/usr/bin/dockerd --registry-mirror= your Huawei cloud accelerator address

8. Finally restart Docker

 systemctl daemon-reload

 systemctl restart docker
Copy the code

9. Verify the Docker acceleration configuration

ps -ef | grep docker

Here we see just configured Huawei Cloud Docker acceleration addressFinally, enjoy the super speed !!!! Docker pull app implementation speed

docker pull wordpress
docker pull mariadb

Copy the code