From c5d53aa09ffafeb3ae4dd683ace73debfc057274 Mon Sep 17 00:00:00 2001 From: kev Date: Sat, 18 Jun 2016 14:57:59 +0800 Subject: [PATCH] add registry --- README.md | 1 + registry/README.md | 42 +++++++++++++++++++++++++++++++++++++ registry/docker-compose.yml | 15 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 registry/README.md create mode 100644 registry/docker-compose.yml diff --git a/README.md b/README.md index f93aa53..7d20929 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,7 @@ A collection of delicious docker recipes. - [x] neo4j - [x] owncloud - [x] phpmyadmin +- [x] registry - [x] rocket.chat - [x] scrapinghub/splash - [ ] selenium diff --git a/registry/README.md b/registry/README.md new file mode 100644 index 0000000..c150166 --- /dev/null +++ b/registry/README.md @@ -0,0 +1,42 @@ +registry +======== + +[Registry][1] is the Docker toolset to pack, ship, store, and deliver content. + +## docker-compose.yml + +```yaml +registry: + image: registry:2 + ports: + - "5000:5000" + volumes: + - ./data:/var/lib/registry + - ./certs:/certs + - ./auth:/auth + environment: + - REGISTRY_HTTP_TLS_CERTIFICATE=/certs/easypi.info.crt + - REGISTRY_HTTP_TLS_KEY=/certs/easypi.info.key + - REGISTRY_AUTH=htpasswd + - REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm + - REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd + restart: always +``` + +## up and running + +```bash +$ docker-compose up -d +$ docker-compose exec registry bash +>>> htpasswd -Bbn username password >> /auth/htpasswd +>>> exit + +$ docker pull alpine +$ docker tag alpine easypi.info:5000/alpine + +$ docker login -u username -p password easypi.info:5000 +$ docker push easypi.info:5000/alpine +$ docker pull easypi.info:5000/alpine +``` + +[1]: https://github.com/docker/distribution diff --git a/registry/docker-compose.yml b/registry/docker-compose.yml new file mode 100644 index 0000000..7535973 --- /dev/null +++ b/registry/docker-compose.yml @@ -0,0 +1,15 @@ +registry: + image: registry:2 + ports: + - "5000:5000" + volumes: + - ./data:/var/lib/registry + - ./certs:/certs + - ./auth:/auth + environment: + - REGISTRY_HTTP_TLS_CERTIFICATE=/certs/easypi.info.crt + - REGISTRY_HTTP_TLS_KEY=/certs/easypi.info.key + - REGISTRY_AUTH=htpasswd + - REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm + - REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd + restart: always