Home >Operation and Maintenance >Docker >How docker replaces domestic warehouse

How docker replaces domestic warehouse

王林
王林Original
2020-05-20 10:14:114257browse

How docker replaces domestic warehouse

1. Use the following command to change the pull address to the domestic mirror warehouse

$ docker pull registry.docker-cn.com/myname/myrepo:mytag

For example:

$ docker pull registry.docker-cn.com/library/ubuntu:16.04

2. Use --registry-mirror Configuring the Docker daemon

You can configure the Docker daemon to use Docker official image acceleration by default. In this way, you can speed up image pulling through the official image by default without having to specify registry.docker-cn.com every time you pull.

You can pass in the --registry-mirror parameter when the Docker daemon starts:

$ docker --registry-mirror=https://registry.docker-cn.com daemon

In order to persist the changes permanently, you can modify the /etc/docker/daemon.json file and add On the registry-mirrors key value.

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

Restart Docker after saving the changes to make the configuration take effect.

Recommended tutorial: docker tutorial

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

Statement:
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
Previous article:How to uninstall dockerNext article:How to uninstall docker