Using docker registry from Iran
As an iranian, I’m officially blocked by docker because of US laws. I just started learning docker and I couldn’t even try hello world…
This is a cross-post of my Medium post.
As an iranian, I’m officially blocked by docker because of US laws. I just started learning docker and I couldn’t even try hello world sample 😑
First I tried to use shadowsocks and download my images via proxy but for some reason, I was getting timeout errors and after a while I stopped trying to fix it. (My coworkers didn’t have problem downloading through proxy in their macbooks so it must be docker on windows’ issue)
Then I thought of using a mirror. My first Idea was running a local mirror in office and download through proxy in that mirror but it was rejected because we didn’t have time for that.
I was going to tell them that I myself will run the server but I saw docker’s china mirror and I thought let’s give it a try and voila! I installed minio/minio
without any problems 😎
Now I needed to make docker to always use that registry. Docker has an option for that (obviously!) I needed to set "registry-mirrors"
variable in config file. I tried the location that was suggested in MS docs but it didn’t work and I had to wait soooo long for docker to restart (I waited a lot when I was trying proxy)
Then I found out that it’s located on .docker
directory at user’s home directory at C:/Users/Username/.docker/machine/default/config.json and after restarting docker again, I finally could run docker run hello-world
(although I’m not sure what it’s doing.. yet) without getting “you’re in iran and your’re blocked blah blah blah”. After this try I found out that I could config registry mirror on Daemon section of docker GUI 😁
I also tried this for docker for mac but I failed and I didn’t have time to find out why. I’d be glad to know if you have any idea. Anyways.. enjoy using docker in Iran (or other blocked countries) 😉