Docker Community Forums

Share and learn in the Docker community.

Can not use registry-mirror


(Liu Yang) #1

Expected behavior

Speed up when downloading images after set registry-mirror

Actual behavior

Image download speed not changed ( 20~500 KB/s)

Information

➜ ~ pinata diagnose -u
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.0-beta8.2
Running diagnostic tests:
[ERROR] docker-cli wrong Docker version: 1.11.1 (expected 1.11.0)
[OK] docker-cli
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Error exec: echo “00000003.0000f3a6” | nc -U /var/tmp/com.docker.vsock/connect > /tmp/20160428-203540/diagnostics.tar: exit 1
Docker logs are being collected into /tmp/20160428-203540.tar.gz

Steps to reproduce the behavior

the aliyun registry-mirror can be accessed at https://cr.console.aliyun.com/#/docker/booster after registered

  1. screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
  2. type root to login
  3. echo “DOCKER_OPTS=”$DOCKER_OPTS --registry-mirror=https://xxx.mirror.aliyuncs.com"" | tee -a /etc/default/docker
  4. service docker restart
  5. docker pull node:4.4.3

When I user docker-machine to create a virtualbox vm, the download speed is fast > 1MB/s
docker-machine create --engine-registry-mirror=https://xxx.mirror.aliyuncs.com -d virtualbox default


(Andrevtg) #2

[DEPRECATED SOLUTION FROM BETA 15 ONWARDS]

The proper (and only, I think) way to set daemon options on Docker for Mac (beta) is using the pinata tool.

  • Check current options with:

pinata get daemon

  • Save the output in a daemon.json file
  • Edit the file to hold your mirror settings. Example:

{ "storage-driver":"aufs", "debug":true, "registry-mirrors": [ "http://mymirror.com:5000" ] }

  • Apply these settings:

pinata set daemon @daemon.json


(Liu Yang) #3

@andrevtg Thanks, it works now :slight_smile:


(Ryan Cheung) #4

Thank you guys! It also solve my problem.


(Derekamz) #5

Thanks @andrevtg, It solve my problem.


(Andrevtg) #6

Starting from bet 15 you can set these options on the UI. Much simpler. :slight_smile:


(白宦成) #7

is The Regisrty-mirrors and insecure-registries support more than one mirrors?


(Andrevtg) #8

Yes, both of them do.

These are options to be set on the UI, there is no piñata tool anymore.


(白宦成) #9

Setting like this?

{
  "registry-mirrors": [
    "mirror1","mirror2","...."
  ],
  "insecure-registries": [
    "mirror1","mirror2","...."
  ],
  "debug": false
}