2024-12-14 08:30:24 +01:00

90 lines
2.8 KiB
Markdown

## Description
This docker compose run registry ui (user interface) on docker
## Install
```bash
sudo mkdir -p /home/docker/certs
sudo mkdir -p /home/docker/registry-ui/conf
sudo mkdir -p /home/docker/registry-ui/data
```
Set ***username:*** and ***password:*** in file `config.yml` and copy in `/home/docker/registry-ui/conf/`
```bash
sudo cp config.yml /home/docker/registry-ui/conf/
```
## Certificats
Copy crt, key and CA cert files on `/home/docker/certs/`
## Run
### docker
```bash
docker run --network=host -d -p 8000:8000 -v /home/docker/certs/gmotechCA.crt:/etc/ssl/certs/ca-certificates.crt:ro -v ./config.yml:/opt/config.yml:ro quiq/registry-ui:latest
```
The option `--network` tell to docker to use /etc/hosts instead DNS
### docker compose
```bash
docker compose up -d
```
## Config apache
### http-registry-ui.conf
```bash
# General setup for the virtual host
<VirtualHost *:80>
ServerName registry-ui.gmotech.net
ServerAlias registry-ui
CustomLog logs/registry-ui_access_log common
ErrorLog logs/registry-ui_error_log
# redirect to https
RewriteEngine on
RewriteCond %{SERVER_NAME} =registry-ui [OR]
RewriteCond %{SERVER_NAME} =registry-ui.gmotech.net
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
```
### https-registry-ui.conf
```bash
# general setup for the virtual host
<VirtualHost *:443>
ServerName registry-ui.gmotech.net
ServerAlias registry-ui
CustomLog logs/registry-ui_access_log common
ErrorLog logs/registry-ui_error_log
# ssl
SSLEngine on
SSLHonorCipherOrder on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder on
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4
# enable HTTP/2, if available
Protocols h2 http/1.1
# HTTP Strict Transport Security (mod_headers is required) (63072000 seconds)
Header always set Strict-Transport-Security "max-age=63072000"
# certificats
SSLCertificateFile "/etc/httpd/auth/cert/gmotech.net.crt"
SSLCertificateKeyFile "/etc/httpd/auth/cert/gmotech.net.key"
SSLCertificateChainFile "/etc/httpd/auth/cert/gmotechCA.crt"
# proxy
SSLProxyEngine On
ProxyPreserveHost On
ProxyRequests off
ProxyPass "/" "http://127.0.0.1:8000/"
ProxyPassReverse "/" "http://127.0.0.1:8000/"
</VirtualHost>
```
## Sources
https://medium.com/quiq-blog/docker-registry-ui-874c890d2c9b
https://github.com/Quiq/registry-ui
## Changelog
### v1.0 - 2024-11-30
#### Added
- initial version by [GMo](mailto:gilles.mouchet@gmail.com)