CentOS7下快速搭建Docker私有库
2017-12-06 14:24
337 查看
1. 安装Docker
yum -y install docker
2. 启动Docker服务
systemctl enable docker systemctl start docker
3. 启动Docker私有库
mkdir /home/docker_repo cd /home/docker_repo docker run -d -p 5000:5000 --name registry --restart=always --privileged=true -v $PWD:/var/lib/registry registry:2
4. 提交Docker镜像
docker tag docker.io/hello-world:latest 192.168.1.75:5000/hello-world:latest docker push 192.168.1.75:5000/hello-world
如果push遇到问题,编辑/usr/lib/systemd/system/docker.service,在ExecStart=之后追加一行参数:
--insecure-registry=192.168.1.75:5000 \
然后重启Docker服务:
systemctl daemon-reload systemctl restart docker
5. Docker私有库HTTP API
测试库内已有centos和Docker官方的hello-world镜像查看当前库列表
http://192.168.1.75:5000/v2/_catalog
返回:
{ "repositories": [ "centos", "hello-world" ] }
查看某个库标签列表
http://192.168.1.75:5000/v2/hello-world/tags/list
返回:
{ "name": "hello-world", "tags": [ "latest" ] }
注: 需要把192.168.1.75替换成你的Docker私有库所在服务器IP
相关文章推荐
- Centos7下nginx+owncloud+php+mysql搭建个人私有云
- Centos上搭建docker的私有仓库
- SpringCloud(第 055 篇)CentOS7 搭建 docker-registry 私有库及管理界面
- centos7下docker部署搭建drools-workbench7.5的几点收获
- CentOS 7 : Docker私有仓库搭建和使用
- 在CentOS 7.2上搭建Docker私有镜像仓库
- 详解CentOS 7 : Docker私有仓库搭建和使用
- 四条命令快速搭建centos7下tensorflow的OCR环境
- 转 Centos7下使用Squid快速搭建带认证的HTTP代理服务器
- CentOS 7下快速安装Gitlab,搭建个人或者公司内部使用的Git服务器
- CentOS7搭建Docker私有仓库
- CentOS环境下Docker私有仓库搭建
- SpringCloud(第 055 篇)CentOS7 搭建 docker-registry 私有库及管理界面
- centos 7.1搭建docker本地私有仓库返回500错误
- 快速搭建CentOS7 、docker、Python3
- Centos 7 docker私有仓库的搭建
- centos7下搭建Docker环境以及简单的使用
- 在CentOS7下从0开始搭建docker并发布tomcat项目
- 在CentOS 6上搭建私有的Docker Registry