树莓派安装docker私有镜像仓库

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/liberalliushahe/article/details/83583963

首先拉取registry镜像,官方的registry镜像不支持arm,但是有人提供了适合树莓派的registry镜像

docker pull budry/registry-arm

创建存储仓库的目录

mkdir dockerregistry

运行容器(容器启动就运行)

docker run --name registry-arm -d -p 5000:5000 -v /home/dockerregistry:/var/lib/registry --restart always budry/registry-arm
docker pull tomcat

给这个镜像重新命名

docker tag tomcat 192.168.3.9:5000/tomcat

之后push到仓库

docker push 192.168.3.9:5000/tomcat

vim /etc/docker/deamon.json

{
    "registry-mirrors": [""],
    "insecure-registries": ["192.168.3.9:5000"]
    
}

我在redhat上拉取镜像出现这个问题

docker pull 192.168.3.9:5000/tomcat

Error response from daemon: invalid registry endpoint https://10.52.64.117:5000/v0/: unable to ping registry endpoint https://10.52.64.117:5000/v0/
v2 ping attempt failed with error: Get https://10.52.64.117:5000/v2/: tls: oversized record received with length 20527
v1 ping attempt failed with error: Get https://10.52.64.117:5000/v1/_ping: tls: oversized record received with length 20527. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry 10.52.64.117: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/10.52.64.117:5000/ca.crt
解决方案
vim /etc/sysconfig/docker
在这里插入图片描述
增加红色框内容重启即可解决
主要原因是搭建的私服不支持https,但是客户端默认使用https
其他平台可以试试下边解决方法
vim /usr/lib/systemd/system/docker.service
在这里插入图片描述
增加–insecure-registry XXXX:5000
重启

猜你喜欢

转载自blog.csdn.net/liberalliushahe/article/details/83583963
今日推荐