ab78647906b14df1287df7009be88bd2816ad4bb
home.md
| ... | ... | @@ -46,6 +46,7 @@ SAP is at the center of today’s technology revolution, developing innovations |
| 46 | 46 | * [[Create clickable UI prototypes with Axure|wiki/info/landscape/ui-clickable-prototypes]] |
| 47 | 47 | * [[Webdesign|wiki/info/landscape/webdesign]] |
| 48 | 48 | * [[sail-insight.com website|wiki/info/landscape/sail-insight.com-website]] |
| 49 | +* [[Docker Registry|wiki/info/landscape/docker-registry]] |
|
| 49 | 50 | |
| 50 | 51 | ### Mobile |
| 51 | 52 |
wiki/info/landscape/docker-registry.md
| ... | ... | @@ -0,0 +1,89 @@ |
| 1 | +# Docker Registry |
|
| 2 | + |
|
| 3 | +At ``docker.sapsailing.com`` there is a Docker registry running which mainly holds two repositories: |
|
| 4 | + |
|
| 5 | +- sapsailing |
|
| 6 | +- sapjvm8 |
|
| 7 | + |
|
| 8 | +The ``sapsailing`` repository holds the images built, in particular, by the latest ``master`` branch build. |
|
| 9 | +See the corresponding [Hudson Job Configuration](https://hudson.sapsailing.com/job/SAPSailingAnalytics-master/). |
|
| 10 | + |
|
| 11 | +The files responsible for building the docker images can be found in the Git repository under |
|
| 12 | +``/docker/Dockerfile.tpl`` which is a template patched with a specific release of the SAP |
|
| 13 | +Sailing Analytics using the ``/docker/makeImageForLatestRelease`` script. |
|
| 14 | + |
|
| 15 | +The Docker registry is run based on the ``registry`` and ``docker-registry-ui`` Docker images |
|
| 16 | +tied together by a ``docker-compose`` file found at ``sapsailing.com:/var/log/old/cache/docker/registry/docker-compose.yml``. |
|
| 17 | +The compose file launches a registry and a web UI for the registry. This works hand in hand with a corresponding |
|
| 18 | +Apache httpd configuration found at ``sapsailing.com:/etc/httpd/conf.d/006-docker-registry.conf`` which maps |
|
| 19 | +``docker.sapsailing.com:80`` to port 5000 on which the ``docker-registry-ui`` container is listening. |
|
| 20 | + |
|
| 21 | +The actual Docker registry listens on port 5001 on sapsailing.com. This is additionally exposed by the Apache |
|
| 22 | +reverse proxy server through ``docker-registry.sapsailing.com`` forwarding all ``/v2`` traffic to the |
|
| 23 | +registry container listening on port 5001. |
|
| 24 | + |
|
| 25 | +Both, the external UI and registry access through the Apache httpd reverse proxy require basic authentication |
|
| 26 | +based on the ``/etc/httpd/conf/passwd.git`` password file. To add a user to it, use the ``htpasswd`` command |
|
| 27 | +on ``sapsailing.com`` as user ``root``, e.g., as follows: |
|
| 28 | +``` |
|
| 29 | + htpasswd /etc/httpd/conf/passwd.git the_new_user |
|
| 30 | +``` |
|
| 31 | +followed by entering the new user's password twice. |
|
| 32 | + |
|
| 33 | +The actual registry configuration is found in ``sapsailing.com:/var/log/old/cache/docker/registry/registry-config.yml``. |
|
| 34 | +It is mapped in the ``docker-compose.yml`` file using a corresponding volume specification. |
|
| 35 | + |
|
| 36 | +For reference, here goes the ``docker-compose.yml`` file: |
|
| 37 | +``` |
|
| 38 | +version: '3.7' |
|
| 39 | +services: |
|
| 40 | + registry: |
|
| 41 | + image: registry:latest |
|
| 42 | + ports: |
|
| 43 | + - 5001:5001 |
|
| 44 | + volumes: |
|
| 45 | + - /var/log/old/cache/docker/registry:/var/lib/registry |
|
| 46 | + - /var/log/old/cache/docker/registry/registry-config.yml:/etc/docker/registry/config.yml |
|
| 47 | + networks: |
|
| 48 | + - registry-ui-net |
|
| 49 | + restart: unless-stopped |
|
| 50 | + ui: |
|
| 51 | + image: joxit/docker-registry-ui:latest |
|
| 52 | + ports: |
|
| 53 | + - 5000:80 |
|
| 54 | + environment: |
|
| 55 | + - REGISTRY_TITLE=SAP Sailing Analytics Docker Registry |
|
| 56 | + - NGINX_PROXY_PASS_URL=http://registry:5001 |
|
| 57 | + # - REGISTRY_URL=http://registry:5001 |
|
| 58 | + - SINGLE_REGISTRY=true |
|
| 59 | + - DELETE_IMAGES=true |
|
| 60 | + depends_on: |
|
| 61 | + - registry |
|
| 62 | + networks: |
|
| 63 | + - registry-ui-net |
|
| 64 | + restart: unless-stopped |
|
| 65 | +networks: |
|
| 66 | + registry-ui-net: |
|
| 67 | +``` |
|
| 68 | + |
|
| 69 | +The ``registry-config.yml`` file currently looks like this: |
|
| 70 | +``` |
|
| 71 | +version: 0.1 |
|
| 72 | +log: |
|
| 73 | + fields: |
|
| 74 | + service: registry |
|
| 75 | +storage: |
|
| 76 | + delete: |
|
| 77 | + enabled: true |
|
| 78 | + cache: |
|
| 79 | + blobdescriptor: inmemory |
|
| 80 | + filesystem: |
|
| 81 | + rootdirectory: /var/lib/registry |
|
| 82 | +http: |
|
| 83 | + addr: :5001 |
|
| 84 | + headers: |
|
| 85 | + Access-Control-Allow-Origin: ['*'] |
|
| 86 | + Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE'] |
|
| 87 | + Access-Control-Expose-Headers: ['Docker-Content-Digest'] |
|
| 88 | + |
|
| 89 | +``` |