Home > Operation and Maintenance > Docker > How to change the image warehouse in docker

How to change the image warehouse in docker

王林
Release: 2020-04-14 13:11:43
Original
5734 people have browsed it

How to change the image warehouse in docker

After Docker is installed, its official image warehouse is used by default. However, this warehouse is not very friendly to domestic developers and is very slow. Therefore, we need to change this before officially using docker. The default image repository.

1. Modify the file /etc/docker/daemon.json (if the file does not exist, you can create it directly) and fill in the following content:

{
    "registry-mirrors": [
        "https://registry.docker-cn.com"
    ]
}
Copy after login

How to change the image warehouse in docker

2. Restart the Docker service. You need to confirm that the restart is successful.

systemctl restart docker # 重启docker服务
systemctl status docker  # 确认docker服务正常运行
Copy after login

3. Confirm that the new mirror warehouse configuration is successful.

docker info
Copy after login

From the printed information, find the option "Registry Mirrors" , confirm that it is the address of the mirror warehouse we configured. If it is not or does not have this option, it means that the configuration of the mirror warehouse failed and needs to be done again!

Recommended tutorial: docker tutorial

The above is the detailed content of How to change the image warehouse in docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template