Add feature to change the base path.

This commit is contained in:
Yuhi Ishikura
2018-06-07 22:36:40 +09:00
parent eabcf48494
commit a5fc3a5d30
11 changed files with 133 additions and 31 deletions

View File

@@ -9,8 +9,8 @@ $ docker-compose up -d
As an example, push the docker-registry-ui image to the local Docker Registry.
```bash
$ docker tag quiq/docker-registry-ui localhost:5000/quiq/docker-registry-ui
$ docker push localhost:5000/quiq/docker-registry-ui
$ docker tag quiq/docker-registry-ui localhost/quiq/docker-registry-ui
$ docker push localhost/quiq/docker-registry-ui
The push refers to repository [localhost:5000/quiq/docker-registry-ui]
ab414a599bf8: Pushed
a8da33adf86e: Pushed
@@ -22,4 +22,4 @@ latest: digest: sha256:d88c1ca40986a358e59795992e87e364a0b3b97833aade5abcd79dda0
```
Then you will find the pushed repository 'quiq/docker-registry-ui' in the following URL.
http://localhost:8000/quiq/docker-registry-ui
http://localhost/ui/quiq/docker-registry-ui

79
example/config/httpd.conf Normal file
View File

@@ -0,0 +1,79 @@
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule headers_module modules/mod_headers.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule unixd_module modules/mod_unixd.so
<IfModule unixd_module>
User daemon
Group daemon
</IfModule>
ServerAdmin you@example.com
ErrorLog /proc/self/fd/2
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog /proc/self/fd/1 common
</IfModule>
ServerRoot "/usr/local/apache2"
Listen 80
<Directory />
AllowOverride none
Require all denied
</Directory>
<VirtualHost *:80>
ServerName myregistrydomain.com
Header always set "Docker-Distribution-Api-Version" "registry/2.0"
Header onsuccess set "Docker-Distribution-Api-Version" "registry/2.0"
ProxyRequests off
ProxyPreserveHost on
# no proxy for /error/ (Apache HTTPd errors messages)
ProxyPass /error/ !
ProxyPass /v2 http://registry:5000/v2
ProxyPassReverse /v2 http://registry:5000/v2
<Location /v2>
Order deny,allow
Allow from all
</Location>
ProxyPass /ui/ http://registry-ui:8000/ui/
ProxyPassReverse /ui/ http://registry-ui:8000/ui/
<Location /ui>
Order deny,allow
Allow from all
</Location>
</VirtualHost>

View File

@@ -1,5 +1,7 @@
# Listen interface.
listen_addr: 0.0.0.0:8000
# Base path of Docker Registry UI.
base_path: /ui
# Registry URL with schema and port.
registry_url: http://registry:5000

View File

@@ -1,10 +1,17 @@
version: "2.3"
services:
httpd:
image: httpd:2.4
ports:
- "80:80"
volumes:
- "./config/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro"
registry:
image: registry:2
ports:
- "5000:5000"
- "5000"
volumes:
- "./data/registry:/var/lib/registry"
healthcheck:
@@ -15,10 +22,10 @@ services:
registry-ui:
image: quiq/docker-registry-ui:latest
ports:
- "8000:8000"
- "8000"
volumes:
- "./data/registry-ui:/opt/data"
- "./config.yml:/opt/config.yml:ro"
- "./config/registry-ui.yml:/opt/config.yml:ro"
depends_on:
registry:
condition: service_healthy