Can not use registry-mirror

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

[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

@andrevtg Thanks, it works now :slight_smile:

Thank you guys! It also solve my problem.

Thanks @andrevtg, It solve my problem.

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

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

Yes, both of them do.

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

Setting like this?

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