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.
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 passinghttp_proxy
environmental variable so the container uses my http proxy for accessing the Internet. you can even authenticate if your proxy needs authentication.