设置/var/lib/boot2docker/profile 无效
小编只是大自然的搬运工,本问答整理自阿里技术天团正在解答Docker技术难题
需要在/var/lib/boot2docker/profile中添加--insecure-registry的配置,修改后需要重启docker的服务,可以执行sudo /etc/init.d/docker restart 或者直接docker-machine restart {machine name}
【 curl http://139.198.2.55:5000/v1/search】能成功
【docker search 139.198.2.55:5000/nginx】显示如下
Error response from daemon: invalid registry endpoint https://139.198.2.55:5000/v1/: Get https://139.198.2.55:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry 139.198.2.55: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/139.198.2.55:5000/ca.crt
回复@豆豆爸:
你需要配置--insecure-registry到配置文件,请参考下我下面用你这个仓库的配置方式:
docker@test1:~$ sudo vi /var/lib/boot2docker/profile
docker@test1:~$ cat /var/lib/boot2docker/profile
EXTRA_ARGS='
--label provider=virtualbox
--insecure-registry 139.198.2.55:5000
'
CACERT=/var/lib/boot2docker/ca.pem
DOCKER_HOST='-H tcp://0.0.0.0:2376'
DOCKER_STORAGE=aufs
DOCKER_TLS=auto
SERVERKEY=/var/lib/boot2docker/server-key.pem
SERVERCERT=/var/lib/boot2docker/server.pem
docker@test1:~$ sudo /etc/init.d/docker restart
Need TLS certs for test1,127.0.0.1,10.0.2.15,192.168.99.100
-------------------
docker@test1:~$ docker search 139.198.2.55:5000/nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
library/nginx 0
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。