docker私有仓库push遇到证书错误

Posted on Posted in docker
Tips: 本文创建于2015年1月14日,已超过 2 年,内容或图片可能已经失效!

错误

FATA[0002] Error: Invalid registry endpoint https://lhh-mac:5000/v1/: Get https://lhh-mac:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry lhh-mac: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/lhh-mac:5000/ca.crt

解决

修改/etc/init/docker.conf,找到(我的在最后)

script
	# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
	DOCKER=/usr/bin/$UPSTART_JOB
	DOCKER_OPTS=
	if [ -f /etc/default/$UPSTART_JOB ]; then
		. /etc/default/$UPSTART_JOB
	fi
	exec "$DOCKER" -d $DOCKER_OPTS
end script

改为

script
	# modify these in /etc/default/$UPSTART_JOB (/etc/default/docker)
	DOCKER=/usr/bin/$UPSTART_JOB
	DOCKER_OPTS=
	if [ -f /etc/default/$UPSTART_JOB ]; then
		. /etc/default/$UPSTART_JOB
	fi
	exec "$DOCKER" -d $DOCKER_OPTS --insecure-registry lhh-mac:5000
end script

搜索私有仓库中的镜像

curl -XGET http://lhh-mac:5000/v1/search?q=ubuntu
或
docker search lhh-mac:5000/ubuntu

 

Leave a Reply

Your email address will not be published. Required fields are marked *

twelve − 2 =