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 use Docker Image Accelerator

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly shows you "how to use Docker Image Accelerator". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use Docker Image Accelerator".

Docker image accelerator

The first step in using Docker should be to obtain an official image, such as mysql and wordpress, based on which we can develop our own personalized applications. We can use the Docker command line tool to download the official image.

However, due to network reasons, it takes a long time to download a 300m image, or even fails to download. For this reason, Ali Cloud Container Hub service provides official mirror sites to accelerate the download speed of official images.

Get the address of the mirror accelerator

There are some differences in how accelerators are configured under different systems, so we introduce the configuration methods of several major operating systems.

As for the address of the accelerator, you only need to log in to the console of the container image service, and the accelerator help page on the left will display the acceleration address assigned to you independently.

When your docker version is newer

When you download and install a Docker Version of no 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)

{"registry-mirrors": [""]}

Just restart Docker Daemon.

When your docker version is older

The corresponding configuration file can only be modified according to the system.

Ubuntu 12.04 14.04

The configuration file for Ubuntu is located in / etc/default/docker

All you need to do is add the accelerator configuration item in this configuration file and restart Docker.

Echo "DOCKER_OPTS=\"\ $DOCKER_OPTS-- registry-mirror=\ "" | sudo tee-a / etc/default/dockersudo service docker restart

Ubuntu 15.04 15.10

There have been some changes in the configuration of accelerators after Ubuntu 15.04.

The configuration file for Ubuntu is located in the / etc/systemd/system/docker.service.d/ directory

Creating any * .conf file in this directory can be used as a configuration file. Then in this configuration file, add the configuration item for the accelerator and restart Docker.

Sudo mkdir-p / etc/systemd/system/docker.service.dsudo tee / etc/systemd/system/docker.service.d/mirror.conf

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

Servers

Wechat

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

12
Report