仓库管理
2016-06-12 14:01
183 查看
仓库管理
docker pull registry //下载registry 镜像,registy为docker官方提供的一个镜像,我们可以用它来创建本地的docker私有仓库。
docker run -d -p 5000:5000 registry //以registry镜像启动容器,监听5000端口
curl 127.0.0.1:5000 //可以访问它
下面我们来把其中一个镜像上传到私有仓库
1. docker tag aming_test 172.7.15.106:5000/centos //标记一下tag,必须要带有私有仓库的ip:port
2. docker push 172.7.15.106:5000/centos //此时报错了类似如下
Error response from daemon: invalid registry endpoint https://172.7.15.106:5000/v0/: unable to ping registry endpoint https://172.7.15.106:5000/v0/ v2 ping attempt failed with error: Get https://172.7.15.106:5000/v2/: EOF
v1 ping attempt failed with error: Get https://172.7.15.106:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 172.7.15.106:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/172.7.15.106:5000/ca.crt
这是因为Docker从1.3.X之后,与docker registry交互默认使用的是https,然而此处搭建的私有仓库只提供http服务,所以当与私有仓库交互时就会报上面的错误。为了解决这个问题需要在启动docker server时增加启动参数为默认使用http访问。解决该问题的方法为:
vi /etc/init.d/docker
把 $exec -d $other_args 改为
$exec -d --insecure-registry 172.7.15.106:5000 $other_args
然后重启docker
service docker restart
再启动registry容器
docker start registry_container_id
curl http://172.7.15.106:5000/v1/search //可以查看私有仓库里面的所有镜像
docker pull registry //下载registry 镜像,registy为docker官方提供的一个镜像,我们可以用它来创建本地的docker私有仓库。
docker run -d -p 5000:5000 registry //以registry镜像启动容器,监听5000端口
curl 127.0.0.1:5000 //可以访问它
下面我们来把其中一个镜像上传到私有仓库
1. docker tag aming_test 172.7.15.106:5000/centos //标记一下tag,必须要带有私有仓库的ip:port
2. docker push 172.7.15.106:5000/centos //此时报错了类似如下
Error response from daemon: invalid registry endpoint https://172.7.15.106:5000/v0/: unable to ping registry endpoint https://172.7.15.106:5000/v0/ v2 ping attempt failed with error: Get https://172.7.15.106:5000/v2/: EOF
v1 ping attempt failed with error: Get https://172.7.15.106:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 172.7.15.106:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/172.7.15.106:5000/ca.crt
这是因为Docker从1.3.X之后,与docker registry交互默认使用的是https,然而此处搭建的私有仓库只提供http服务,所以当与私有仓库交互时就会报上面的错误。为了解决这个问题需要在启动docker server时增加启动参数为默认使用http访问。解决该问题的方法为:
vi /etc/init.d/docker
把 $exec -d $other_args 改为
$exec -d --insecure-registry 172.7.15.106:5000 $other_args
然后重启docker
service docker restart
再启动registry容器
docker start registry_container_id
curl http://172.7.15.106:5000/v1/search //可以查看私有仓库里面的所有镜像
相关文章推荐
- Linux文本处理三剑客之grep
- 正确的参数进行了评估
- 容器管理
- 多线程程序何时需要加锁
- 关于Environment.getExternalStorageDirectory()不能获取SD卡路径问题
- String、StringBuffer、StringBuilder的区别
- (二)企业部分之lnmp环境的搭建:mysql源码安装
- 创建镜像
- impala不能查询hive中新增加的表问题
- MySQL 基本操作之数据库操作
- 网站页面的颜色和线条搭配
- UITextField限制个数,没用代理
- 淘宝开源消息中间件-Metamorphosis
- Docker安装
- View的测量过程学习onMeasure
- CSS基础
- 千万级规模高性能、高并发的网络架构经验
- texturepacker
- git 基本操作
- 正则表达式