我有一个定制的码头注册中心,可以通过http://localhost:5000访问
下面是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>在这里,我如何启动注册表:
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一切正常(码头拉,.),但docker push失败。在重新尝试之后,这里显示的错误消息如下:
first path segment in URL cannot contain colon相关的文档可以在这里找到:
发布于 2021-01-20 06:57:59
使用docker组合,我使用图像jwilder/nginx-proxy:alpine作为代理,它的工作效率要好得多。
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.com这样,我就可以在同一个主机上拥有Docker注册中心及其相应的GUI。
https://stackoverflow.com/questions/60774029
复制相似问题