This is to avoid using docker login
on every machine on LAN. By using this proxy you can
provide unrestricted access to a private registry.
- Use
docker login
once to generate credentials. - Inspect
$HOME/.docker/config.json
, findauth
for the registry:{ "auths": { "registry.example.com": { "auth": "YOU NEED THIS STRING" } } }
- Fill in the environment variables in
docker-compose.yml
:NGINX_SERVER_NAME
: host name of the proxy.NGINX_AUTH_CREDENTIALS
: theauth
hash you've got during the previous step.NGINX_PROXY_TO
: URL of the private registry.
- Bring up the proxy with
docker-compose up
and test it withdocker pull $NGINX_SERVER_NAME/image:tag
.