happy_boy 发表于 2015-12-25 08:17:01

如何搭建Docker私有仓库

  1,用 git 下载源码后修改配置文件 config.yml,把 storage_path 部分改成 Docker 镜像仓库的存放地点:


$ git clone https://github.com/dotcloud/docker-registry
$ cd docker-registry$ cp config_sample.yml config.yml
$ vi config.yml
...
# This is the default configuration when no flavor is specified
dev:
    storage: local
    storage_path: /home/vpsee/registry
    loglevel: debug
...
  $ mkdir /home/vpsee/registry
  2,安装一些必要软件包和一些 Docker-Registry 需要用到的 Python 工具和库:
$ sudo apt-get install build-essential python-dev libevent-dev python-pip libssl-dev
  $ sudo pip install -r requirements.txt
  
Docker-Registry 实际上是个基于 Flask 的 web app,安装成功后就可以这样运行了:
$ sudo gunicorn --access-logfile - --debug -k gevent -b 0.0.0.0:80 -w 1 wsgi:application
  3,打开浏览器,访问 IP 地址就可以看到 docker-registry 私有仓库在运行了:
页: [1]
查看完整版本: 如何搭建Docker私有仓库