您的位置:首页技术文章
文章详情页

docker镜像push报错

日期:2023-11-30浏览:322作者:猪猪【字号:
导读:问题描述服务器上的registry已经启动了看了下文档要使用Insecure Registry要添加DOCKER_OPTS='--insecure-registry myregis...

问题描述

服务器上的registry已经启动了

docker镜像push报错

看了下文档要使用Insecure Registry要添加DOCKER_OPTS='--insecure-registry myregistrydomain.com:5000'但没有找到/etc/sysconfig/docker这文件,所以就在docker.service里添加了如下(centos7好像没/etc/sysconfig/docker这文件了)

ExecStart=/usr/bin/docker daemon --registry-mirror=https://187wuopo.mirror.aliyuncs.com --insecure-registry 121.42.217.35:5000 -H fd://

sudo docker push 121.42.217.35:5000/php:7

报错:Get https://121.42.217.35:5000/v1/_ping: tls: oversized record received with length 20527

感觉是DOCKER_OPTS放错地方了...

问题解答

回答1:

可能是/etc/default/docker这个地址?修改/添加DOCKER_OPTS如下:

DOCKER_OPTS='--insecure-registry 121.42.217.35:5000'回答2:

docker issue 14513: http://www.artificialworlds.n...

解法:

# create docker override config: '/etc/systemd/system/docker.service.d/override.conf'# add the settings below[Service] ExecStart= ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry=192.168.1.201:5000# restart docker servicesystemctl stop dockersystemctl start docker# start to pull images from private docker registrydocker pull 192.168.1.201:5000/puya_mbk_centos67

相关文章: