From eabcf4849480531de563f98568ef7ee884d22807 Mon Sep 17 00:00:00 2001 From: Yuhi Ishikura Date: Thu, 7 Jun 2018 21:46:53 +0900 Subject: [PATCH] Add example. --- example/.gitignore | 1 + example/README.md | 25 ++++++++++++++++++++++ example/config.yml | 44 ++++++++++++++++++++++++++++++++++++++ example/docker-compose.yml | 24 +++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 example/.gitignore create mode 100644 example/README.md create mode 100644 example/config.yml create mode 100644 example/docker-compose.yml diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..249cda9 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1 @@ +/data \ No newline at end of file diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..d175ea6 --- /dev/null +++ b/example/README.md @@ -0,0 +1,25 @@ +# Docker Registry UI Example + +Start the local Docker Registry and UI. + +```bash +$ 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 +The push refers to repository [localhost:5000/quiq/docker-registry-ui] +ab414a599bf8: Pushed +a8da33adf86e: Pushed +71a0e0a972a7: Pushed +96dc74eb5456: Pushed +ac362bf380d0: Pushed +04a094fe844e: Pushed +latest: digest: sha256:d88c1ca40986a358e59795992e87e364a0b3b97833aade5abcd79dda0a0477e8 size: 1571 +``` + +Then you will find the pushed repository 'quiq/docker-registry-ui' in the following URL. +http://localhost:8000/quiq/docker-registry-ui diff --git a/example/config.yml b/example/config.yml new file mode 100644 index 0000000..f65f591 --- /dev/null +++ b/example/config.yml @@ -0,0 +1,44 @@ +# Listen interface. +listen_addr: 0.0.0.0:8000 + +# Registry URL with schema and port. +registry_url: http://registry:5000 +# Verify TLS certificate when using https. +verify_tls: true + +# Docker registry credentials. +# They need to have a full access to the registry. +# If token authentication service is enabled, it will be auto-discovered and those credentials +# will be used to obtain access tokens. +# registry_username: user +# registry_password: pass + +# Event listener token. +# The same one should be configured on Docker registry as Authorization Bearer token. +event_listener_token: token +# Retention of records to keep. +event_retention_days: 7 + +# Event listener storage. +event_database_driver: sqlite3 +event_database_location: data/registry_events.db +# event_database_driver: mysql +# event_database_location: user:password@tcp(localhost:3306)/docker_events + +# Cache refresh interval in minutes. +# How long to cache repository list and tag counts. +cache_refresh_interval: 10 + +# If users can delete tags. If set to False, then only admins listed below. +anyone_can_delete: false +# Users allowed to delete tags. +# This should be sent via X-WEBAUTH-USER header from your proxy. +admins: [] + +# Debug mode. Affects only templates. +debug: true + +# CLI options. +# How many days to keep tags but also keep the minimal count provided no matter how old. +purge_tags_keep_days: 90 +purge_tags_keep_count: 2 diff --git a/example/docker-compose.yml b/example/docker-compose.yml new file mode 100644 index 0000000..dd80fd8 --- /dev/null +++ b/example/docker-compose.yml @@ -0,0 +1,24 @@ +version: "2.3" + +services: + registry: + image: registry:2 + ports: + - "5000:5000" + volumes: + - "./data/registry:/var/lib/registry" + healthcheck: + test: ["CMD", "wget", "-s", "localhost:5000/v2/"] + interval: 5s + timeout: 10s + + registry-ui: + image: quiq/docker-registry-ui:latest + ports: + - "8000:8000" + volumes: + - "./data/registry-ui:/opt/data" + - "./config.yml:/opt/config.yml:ro" + depends_on: + registry: + condition: service_healthy