在虚拟服务器ubuntu 14.04上我安装了docker,我尝试将一个映像推送到本地注册表.我在Docker博客上遵循了这个指南但是当我尝试推送图像时,我有这个输出:
错误:无效的注册表端点https://xx.xx.xx.xx/v1/:获取https://xx.xx.xx.xx/v1/_ping:x509:证书已过期或尚未生效.如果此私有注册表仅支持具有未知CA证书的HTTP或HTTPS,请添加
--insecure-registry xx.xx.xx.xx到守护程序的参数.对于HTTPS,如果您可以访问注册表的CA证书,则不需要该标志; 只需将CA证书放在/etc/docker/certs.d/xx.xx.xx.xx/ca.crt即可
我尝试添加--insecure-registry xx.xx.xx.xx的/etc/default/docker文件并重新启动搬运工服务.Docker无法以消息开头/proc/self/fd/9: 17: /etc/default/docker: --insecure-registry: not found.
PS:我在docker容器中运行我的注册表
我遇到了与Ubuntu 12.04和Docker 1.4.1相同的问题.这是我的解决方案:
$ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
FATA[0002] Error: Invalid registry endpoint https://[host:ip:v6:addr:ess:is:here]:5000/v1/: Get https://[host:ip:v6:addr:ess:is:here]:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry [host:ip:v6:addr:ess:is:here]: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/[host:ip:v6:addr:ess:is:here]:5000/ca.crt
Run Code Online (Sandbox Code Playgroud)
所以,我有一个错误.
$ ps axwww | grep /usr/bin/docker
14655 ? Ssl 2:06 /usr/bin/docker -d
14869 pts/0 S+ 0:00 grep /usr/bin/docker
Run Code Online (Sandbox Code Playgroud)
请注意,/ usr/bin/docker没有额外的参数.
$ echo 'DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"' | sudo tee -a /etc/default/docker
DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"
$ sudo service docker restart
docker stop/waiting
docker start/running, process 15615
Run Code Online (Sandbox Code Playgroud)
让我们检查参数是否出现:
$ ps axwww | grep /usr/bin/docker
15615 ? Ssl 0:00 /usr/bin/docker -d --insecure-registry [host:ip:v6:addr:ess:is:here]:5000
15663 pts/0 S+ 0:00 grep /usr/bin/docker
Run Code Online (Sandbox Code Playgroud)
是的,他们这样做.还有一次尝试:
$ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
The push refers to a repository [[host:ip:v6:addr:ess:is:here]:5000/myImage] (len: 1)
Sending image list
Pushing repository [host:ip:v6:addr:ess:is:here]:5000/myImage (1 tags)
511136ea3c5a: Image successfully pushed
27d47432a69b: Pushing [================================================> ] 189.8 MB/197.2 MB 0
Run Code Online (Sandbox Code Playgroud)
直接在主机上设置 docker 注册表是相当令人沮丧的。设置本地 docker 存储库的最简单方法是使用 docker-registry docker 镜像。只需执行
docker run -p 5000:5000 -d registry
Run Code Online (Sandbox Code Playgroud)
docker 应该下载官方的 docker 注册表镜像。之后,您可以附加到容器并自定义设置。来源: http ://www.devops-insight.com/2014/12/using-private-docker-repository-registry.html
| 归档时间: |
|
| 查看次数: |
7348 次 |
| 最近记录: |