问题原文
原帖链接 · Farhad Farahi · CC BY-SA 3.0
I'm trying to setup a caching local registry for docker using official registry:latest Image.
I want to make this container use organizations http proxy for internet access when trying to pull from docker hub.
any help would be appretiated.
P.S you can follow this guide to create a caching local registry.
已采纳解答
原帖链接 · Farhad Farahi · CC BY-SA 3.0
After hours of trying different stuff, answering my own question to help others.
sudo docker run -d -p 5000:5000 -v /home/myhomedirectory/test:/var/lib/registry -e http_proxy=http://organizationswebproxyaddress:port/ --name registry registry /var/lib/registry/config.yml
Look at -e switch with -e switch you can pass in environmental variables to the container. In this case im passing http_proxy environmental variable so the container uses my http proxy for accessing the Internet. you can even authenticate if your proxy needs authentication.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
