项目作者: maxim-avramenko

项目描述 :
private registry for docker images
高级语言: Shell
项目地址: git://github.com/maxim-avramenko/registry.git
创建时间: 2018-12-27T00:25:36Z
项目社区:https://github.com/maxim-avramenko/registry

开源协议:

下载


Private Docker Registry

Sometimes you don’t want to share your awesome application code with other world.

Private registry for docker images with your application code inside the image lets you restrict access by login and password.

You must use TLS encrypted connection

For example you can use CloudFlare service for your hub.mydomain.com

to play with private registry on localhost add domain name to system hosts file (/etc/hosts for Linux users)

Set up steps:

  1. * create user and password
  2. * run init script

Usage:

  1. $ ./adduser <username> <password>
  2. $ ./init <domain.name>

Example:

  1. $ ./adduser maxim MyStrongSecretPassword123 \
  2. && ./init hub.mydomain.com

After registry service start you can use your credentials to login and push/pull docker images:

  1. # login to your new private registry
  2. $ docker login hub.mydomain.com
  3. Login: maxim
  4. Password: MyStrongSecretPassword123
  5. # for example pull ubuntu:18.04 from public registry and push it to your private
  6. $ docker pull ubuntu:18.04
  7. $ docker tag ubuntu:18.04 hub.mydomain.com/ubuntu:18.04
  8. $ docker push hub.mydomain.com/ubuntu:18.04
  9. $ docker rmi ubuntu:18.04 hub.mydomain.com/ubuntu:18.04
  10. # check that you have no more ubuntu:18.04 images
  11. $ docker images
  12. # pull ubuntu:18.04 from your hub.mydomain.com registry
  13. $ docker pull hub.mydomain.com/ubuntu:18.04

Now you have your own private registry for docker images.

You can add more users if you want, use:

  1. ./adduser <username> <password>