CentOS 7 搭建docker仓库
2017-02-13 18:32
309 查看
docker已经足够火了,试想每次部署都要飘洋过海去docker官方仓库拉镜像,肯定受不了,所以必须搭建内网私有docker仓库,充分利用高速内网带宽。
1、安装docker
也可以从别的地方获取,比如
比如端口(默认5000),镜像存储路径(默认/var/lib/registry)
5、查看本地镜像
6、给本地docker镜像打标签
11、修改docker配置文件,默认使用内网仓库
修改文件/etc/sysconfig/docker
1、安装docker
yum install docker2、开启docker服务
systemctl enable docker systemctl start docker3、获取docker镜像
docker pull centos上面是从docker官方仓库获取centos镜像,速度很慢。
也可以从别的地方获取,比如
docker pull index.tenxcloud.com/tenxcloud/centos4、安装并启用 docker-distribution
yum install docker-distribution systemctl enable docker-distribution systemctl start docker-distribution可以根据需要修改docker-distribution的配置文件 /etc/docker-distribution/registry/config.yml
比如端口(默认5000),镜像存储路径(默认/var/lib/registry)
5、查看本地镜像
docker images示例输出如下:
# docker images REPOSITORY TAG IMAGE ID CREATED SIZE index.tenxcloud.com/tenxcloud/centos latest 6e7516266d96 9 months ago 309.9 MB
6、给本地docker镜像打标签
docker tag 6e7516266d96 localhost:5000/centos:latest7、把镜像发布到仓库中
docker push localhost:5000/centos:latest8、删除本地镜像
docker rmi index.tenxcloud.com/tenxcloud/centos docker rmi localhost:5000/centos docker images9、从仓库中获取镜像
docker pull localhost:5000/centos:latest10、查看刚刚本地拉取的镜像
docker images
11、修改docker配置文件,默认使用内网仓库
修改文件/etc/sysconfig/docker
#添加内网仓库 ADD_REGISTRY='--add-registry localhost:5000' #禁用官方仓库docker.io(可选) BLOCK_REGISTRY='--block-registry docker.io'
相关文章推荐
- centos 7.1搭建docker本地私有仓库返回500错误
- 详解CentOS 7 : Docker私有仓库搭建和使用
- CentOS 7 : Docker私有仓库搭建和使用
- Docker CentOS服务器搭建本地私有仓库
- centos7 Docker私有仓库搭建及删除镜像
- Centos 7 docker私有仓库的搭建
- Centos上搭建docker的私有仓库
- docker 搭建registry私有仓库 (Centos6.5)
- centos下搭建docker私有仓库
- Centos7上Docker仓库Harbor的搭建
- 在CentOS 7.2上搭建Docker私有镜像仓库
- CentOS 7 : Docker私有仓库搭建和使用
- CentOS环境下Docker私有仓库搭建
- Docker之Centos7 Docker私有仓库搭建
- Centos 7中Docker私有仓库的搭建方法
- Centos 7 docker私有仓库的搭建
- CentOS7搭建Docker私有仓库
- Docker系列(四)Centos6.5 搭建私人镜像仓库 v2
- CentOS 搭建docker私有仓库实践
- 搭建自己的 Docker 私有仓库服务