How to apply registry-mirrors in rancheros?


#1

I come from China!
Docker is blocked by the national firewall,so downloading images is slow.In ubuntu 16.04,I use sudo tee /etc/docker/daemon.json <<-‘EOF’
{
“registry-mirrors”: [“http://db7dd555.m.daocloud.io”]
}
EOF,
http://db7dd555.m.daocloud.io is for speeding-up.
and then sudo systemctl restart docker,
it works,but using it in rancheros, it works for docker ,not for system-docker,so i can’t pull the images,the speeding-up does not work.Need a lot of time to download and lead to failure.SO what should i do to make “system-docker pull XXX” works and should use what commnads to make it work at once and do not need to reboot the rancheros.
I make it clear? Anyone can help,thank in advance.


#2

Yes clear what you want.

How are registry mirrors added to System Docker?

https://docs.rancher.com/os/configuration/docker/

According to that document linked above, you should do this instead of what you are currently doing (I’ve not tested, only interpreting the docs to what should work)

#cloud-config
rancher:
  docker:
    registry_mirror: "http://db7dd555.m.daocloud.io"
  system_docker:
    registry_mirror: "http://db7dd555.m.daocloud.io"

Hope this works for you


#3

According to your advice,I use(I have installed the rancheros already):
sudo ros config set rancher.docker.registery_mirror http://db7dd555.m.daocloud.io
sudo ros config set rancher.system_docker.registery_mirror http://db7dd555.m.daocloud.io ,
but it does not work at once,when I reboot the rancheros,it works.
So the question is how to make it work at once and don’t need to reboot the rancheros???


#4

So instead of running the commands, put the actual cloud config posted in your cloud-config.yml :slight_smile:

ok?

following Install to Disk docs,

$ sudo ros install -c cloud-config.yml -d /dev/sda
INFO[0000] No install type specified...defaulting to generic
Installing from rancher/os:v0.5.0
Continue [y/N]:

update this cloud-config.yml specified to include

#cloud-config
rancher:
  docker:
    registry_mirror: "http://db7dd555.m.daocloud.io"
  system_docker:
    registry_mirror: "http://db7dd555.m.daocloud.io"

These settings need to be set when docker/system-docker is started, there is no way to alter at runtime by the looks.


#5

I know your meaning,thanks a lot.


#6

Did you try to do it in 2 steps using the docker instructions:


#7

When you use the RancherOS registry-mirror config, it does the rest for you - all in one step.


#8

Hello,

I have the same configuration :

rancher:
  docker:
    registry_mirror: "https://docker-public.recette.local"
  system_docker:
    registry_mirror: "https://docker-public.recette.local"
 registry_auths:
    https://docker-public.recette.local:
      auth: == 

but when I docker search it fails :

[rancher@rancheros1 ~]$ docker search debian
Error response from daemon: Get https://index.docker.io/v1/search?q=debian&n=25: dial tcp 52.3.153.154:443: i/o timeout

My proxy is working, but I need to specify it :

rancher@rancheros1  ~]$ docker search docker-public.recette.local/debian
NAME                                    DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
ubuntu                                  Ubuntu is a Debian-based Linux operating s...   7028      [OK]
debian                                  Debian is a Linux distribution that's comp...   2382      [OK]
google/debian                                                                           52                   [OK]
neurodebian                             NeuroDebian provides neuroscience research...   41        [OK]
armhf/debian                            Debian is a Linux distribution that's comp...   29
arm32v7/debian                          Debian is a Linux distribution that's comp...   23
32bit/debian                            Debian for i386 (32bit)                         21
itscaro/debian-ssh                      debian:jessie                                   20                   [OK]
samueldebruyn/debian-git                a minimal docker container with debian and...   16                   [OK]
resin/armv7hf-debian                    Debian is a Linux distro composed entirely...   15
tianon/debian                           use "debian" instead - https://index.docke...   14
jesselang/debian-vagrant                Stock Debian Images made Vagrant-friendly ...   13                   [OK]
armbuild/debian                         ARMHF port of debian                            12                   [OK]
danielguerra/bro-debian-elasticsearch   Bro on debian with full elasticsearch-2 ki...   11                   [OK]
arm64v8/debian                          Debian is a Linux distribution that's comp...   8
eboraas/debian                          Debian base images, for all currently-avai...   8                    [OK]
i386/debian                             Debian is a Linux distribution that's comp...   7
aarch64/debian                          Debian is a Linux distribution that's comp...   6
armhfbuild/debian                       Debian base images for armhf devices            6
mschuerig/debian-subsonic               Moved to mschuerig/subsonic-docker-image        6                    [OK]
multiarch/debian-debootstrap            multiarch ports of debian-debootstrap           4
rockyluke/debian                        Docker images of Debian.                        4
vergissberlin/debian-development        Docker debian image to use for development...   4                    [OK]
armel/debian                            Debian is a Linux distribution that's comp...   3
davidcaste/debian-oracle-java           Oracle Java 8 (and 7) over Debian Jessie        3                    [OK]

any idea ?