Docker私服Registry搭建
2014-05-19 19:25
513 查看
Docker私服Registry搭建
本文基于docker 1.x,registry 0.7.3搭建过程主要有:
创建私服镜像Registry
关联本地磁盘和Registry container
启动Registry container
创建私服镜像
docker build -t registry https://git.oschina.net/feedao/Docker_shell/raw/start/Dockerfile-registry
其实也可以直接docker pull registry的
启动,并关联本地磁盘
为了防止重启container,造成私服镜像丢失,我们要和本地磁盘关联,进行持久化。本地创建私服镜像目录:
mkdir /opt/docker-image/registry # 可选mkdir /opt/docker-image/registry-config
可选
本地添加配置文件 /opt/docker-image/registry-config/config.ymldev: loglevel: info storage: local storage_path: /opt/registry
通过
-v /opt/docker-image命令将本地的目录
/opt/docker-image绑定到container的
/opt目录。并通过
-e DOCKER_REGISTRY_CONFIG=/opt/registry-config/config.yml设置container的环境变量。如果不设置,则默认使用config_sample.yml
docker run \ -d -p 0.0.0.0:33307:22 \ -p 0.0.0.0:5000:5000 \ -v /opt/docker-image:/opt/docker-image \ -e SQLALCHEMY_INDEX_DATABASE:sqlite:////opt/docker-image/docker-registry.db \ -e STORAGE_PATH=/opt/docker-image \ registry
如何搜索私服上的镜像
curl -XGET http://registry:5000/v1/search?q=镜像名称[/code]
https://github.com/dotcloud/docker-registry
上最新添加了这个功能
更详细的看:http://stackoverflow.com/questions/23733678/how-to-search-images-from-private-registry-in-docker/article/10662385.html
Reference
/content/1352264.html
更仔细的细读官方的吧:https://github.com/dotcloud/docker-registry
相关文章推荐
- docker registry私服搭建
- Docker私服Registry搭建
- 搭建docker内网私服(docker-registry with nginx&ssl on centos)
- 搭建私服-docker registry
- Docker小技巧(二)——私服Registry搭建
- 搭建docker内网私服(docker-registry with nginx&ssl on centos)
- 搭建docker内网私服(docker-registry with nginx&ssl on centos)
- 搭建docker内网私服的方法(docker-registry with nginx&ssl on centos)
- docker registry私服搭建的方法
- [置顶] docker 搭建registry私服
- 搭建docker内网私服(docker-registry with nginx&ssl on centos)
- docker registry私服搭建
- 基于 Docker 搭建Gitlab + ContainerRegistry
- cnpm 私服搭建(基于docker)
- Docker安装以及registry搭建
- 如何在Ubuntu14.04上搭建私有docker registry
- docker registry v2 ssl 环境搭建
- Docker--------registry私有仓库搭建 [ Http ]
- Docker--------Harbor registry安全认证搭建 [ Https ]
- docker私有仓库registry的本地搭建