Tengo un registro de Docker personalizado, accesible a través de http://localhost:5000
Aquí está la configuración de Apache:
Listen 443 <VirtualHost *:443> ServerName registry.mycompany.com SSLEngine on SSLCertificateFile ... SSLCertificateKeyFile ... SSLCACertificateFile /etc/pki/tls/certs/thawte.pem ProxyPreserveHost On ProxyPass / http://localhost:5000/ ProxyPassReverse / http://localhost:5000/ ProxyRequests Off </VirtualHost>Y aquí como empiezo el registro:
docker run -d \ -p 5000:5000 \ -e REGISTRY_STORAGE_DELETE_ENABLED=true \ -e REGISTRY_AUTH=htpasswd \ -e REGISTRY_AUTH_HTPASSWD_REALM="Registro" \ -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ --restart=always \ --name registro \ registry:2 Todo funciona bien (docker pull, ...), pero docker push falla. Después de algunos reintentos aquí se muestra el mensaje de error:
first path segment in URL cannot contain colonEl documento relacionado se puede encontrar aquí:
Con docker compose, uso la imagen jwilder/nginx-proxy:alpine como proxy, y funciona mucho mejor
version: "3.7" services: registry: image: registry:2 expose: - 5000 volumes: - "./registry.yaml:/etc/docker/registry/config.yml" - "./img:/var/lib/registry" - "./certs:/certs" - "./auth:/auth" environment: VIRTUAL_HOST: registry.company.com restart: always gui: image: joxit/docker-registry-ui:static environment: URL: https://registry.company.com REGISTRY_TITLE: Company Docker registry DELETE_IMAGES: "true" VIRTUAL_HOST: gui-registry.company.com #HTTPS_METHOD: nohttps expose: - 80 proxy: image: jwilder/nginx-proxy:alpine ports: - 80:80 - 443:443 volumes: - "/var/run/docker.sock:/tmp/docker.sock:ro" - "./certs:/etc/nginx/certs" - "./registry.conf:/etc/nginx/vhost.d/registro.fccma.com" - "./cors.conf:/etc/nginx/vhost.d/registro.fccma.com_location" environment: DEFAULT_HOST: registro.fccma.comDe esta forma, puedo tener el registro de Docker y su GUI correspondiente en el mismo host.