Docker push to private registry: how not to specify port
When deploying a private registry as instructed by this docker , I have to specify a port in the CLI to send the image like this:
For http ( 80
) command is as follows: docker push host.com:80/alpine
. For https ( 443
) command must be as follows: docker push host.com:443/alpine
. If I compared the port in 5000, a team of: docker push host.com:5000/alpine
.
The desired effect is a simple tap, for example: docker push host.com/alpine
How do I get the full docker run
command docker run
to achieve this goal?
source to share
The default port is 443, as far as I know it cannot be changed. But you can set up NGINX (or HAProxy) on a different host and set it up to proxy all your requests in your registry, something like this:
server {
listen *:443 ssl;
server_name registry.company.com;
proxy_set_header Host upload.expert;
location / {
proxy_pass http://private.registry.company.com:5000;
}
}
And then just docker push registry.company.com/alpine
source to share