Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement Mirror acceleration in docker

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you how to achieve mirror acceleration in docker. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

# step 1: install some necessary system tools

Sudo apt-get update

Sudo apt-get-y install apt-transport-https ca-certificates curl software-properties-common

# step 2: install the GPG certificate

Curl-fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add-

# Step 3: write software source information

Sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release-cs) stable"

# Step 4: update and install Docker-CE

Sudo apt-get-y update

Sudo apt-get-y install docker-ce

# install the specified version of Docker-CE:

# Step 1: find the version of Docker-CE:

# apt-cache madison docker-ce

# docker-ce | 17.03.1~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages

# docker-ce | 17.03.0~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages

# Step 2: install the specified version of Docker-CE: (VERSION, for example, 17.03.1~ce-0~ubuntu-xenial above)

# sudo apt-get-y install docker-ce= [VERSION]

Docker loginsudo docker login-username=XX@qq.com registry.cn-hangzhou.aliyuncs.com

Login Succeeded is displayed after a successful login.

Docker pull

Note:

If you want to pull the official image of Docker, refer to the accelerator documentation in the relevant link below.

If you want to pull the image under the public repository, you can also pull it if you don't log in to Registry.

The Registry logged in must be consistent with the Registry of the image you are operating on. For example, if you only log in to registry.cn-hangzhou.aliyuncs.com and push the image of registry.cn-beijing.aliyuncs.com, the client will receive an unauthorized error message.

When you download and install a Docker Version of not less than 1.10, it is recommended to configure it directly through daemon config. Use the configuration file / etc/docker/daemon.json (create a new file if not available). The contents are as follows:

{"registry-mirrors": ["https://3gocl06m.mirror.aliyuncs.com"]}"

Then execute:

The above content of sudo systemctl daemon-reloadsudo systemctl restart docker is how to achieve mirror acceleration in docker. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report