2016-06-18 08:57:59 +02:00
|
|
|
registry
|
|
|
|
========
|
|
|
|
|
|
|
|
[Registry][1] is the Docker toolset to pack, ship, store, and deliver content.
|
|
|
|
|
|
|
|
## docker-compose.yml
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
registry:
|
2016-08-27 13:44:32 +02:00
|
|
|
image: registry
|
2016-06-18 08:57:59 +02:00
|
|
|
ports:
|
|
|
|
- "5000:5000"
|
|
|
|
volumes:
|
2016-08-27 13:44:32 +02:00
|
|
|
- /etc/docker/registry
|
2016-06-18 08:57:59 +02:00
|
|
|
- ./data:/var/lib/registry
|
|
|
|
- ./certs:/certs
|
|
|
|
- ./auth:/auth
|
|
|
|
environment:
|
2016-06-20 15:33:42 +02:00
|
|
|
- REGISTRY_HTTP_TLS_CERTIFICATE=/certs/registry.easypi.info.crt
|
|
|
|
- REGISTRY_HTTP_TLS_KEY=/certs/registry.easypi.info.key
|
2016-06-18 08:57:59 +02:00
|
|
|
- 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
|
2016-08-27 13:44:32 +02:00
|
|
|
$ docker-compose exec registry sh
|
2016-06-18 08:57:59 +02:00
|
|
|
>>> htpasswd -Bbn username password >> /auth/htpasswd
|
2016-08-27 13:44:32 +02:00
|
|
|
>>> cat >> /etc/docker/registry/config.yml
|
|
|
|
proxy:
|
|
|
|
remoteurl: https://registry-1.docker.io
|
|
|
|
username: username
|
|
|
|
password: password
|
|
|
|
^D
|
2016-06-18 08:57:59 +02:00
|
|
|
>>> exit
|
2016-08-27 13:44:32 +02:00
|
|
|
$ docker-compose restart
|
2016-06-18 08:57:59 +02:00
|
|
|
|
|
|
|
$ docker pull alpine
|
2016-06-20 15:33:42 +02:00
|
|
|
$ docker tag alpine registry.easypi.info:5000/alpine
|
2016-06-18 08:57:59 +02:00
|
|
|
|
|
|
|
$ docker login -u username -p password easypi.info:5000
|
2016-06-20 15:33:42 +02:00
|
|
|
$ docker push registry.easypi.info:5000/alpine
|
|
|
|
$ docker pull registry.easypi.info:5000/alpine
|
2016-06-18 08:57:59 +02:00
|
|
|
```
|
|
|
|
|
2016-06-20 15:33:42 +02:00
|
|
|
## read more
|
|
|
|
|
|
|
|
- https://github.com/docker/distribution/blob/master/docs/deploying.md
|
|
|
|
- https://github.com/docker/distribution/blob/master/docs/insecure.md
|
|
|
|
- https://serversforhackers.com/tcp-load-balancing-with-nginx-ssl-pass-thru
|
2016-08-27 13:44:32 +02:00
|
|
|
- https://github.com/docker/distribution/blob/master/docs/recipes/mirror.md
|
2016-06-20 15:33:42 +02:00
|
|
|
|
2016-06-18 08:57:59 +02:00
|
|
|
[1]: https://github.com/docker/distribution
|