一、Docker私服配置
环境:centos7 + docker + harbor
1. vim /etc/docker/daemon.json
{"insecure-registries":["10.16.211.22:5000","10.16.211.22"]}
2. vim /etc/containers/registries.conf
[registries.search]
registries = ['docker.io','registry.centos.org','registry.access.redhat.com','10.16.211.22:5000','10.16.211.22']
# If you need to access insecure registries, add the registry's fully-qualified name.
# An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
[registries.insecure]
registries = ['10.16.211.22:5000','10.16.211.22']
# If you need to block pull access from a registry, uncomment the section below
# and add the registries fully-qualified name.
# Docker only
[registries.block]
registries = []
修改位置,红色IP为自己搭建的docker仓库私服地址或域名
[registries.search]
registries = ['docker.io','registry.centos.org','registry.access.redhat.com','10.16.211.22:5000','10.16.211.22']
[registries.insecure]
registries = ['10.16.211.22:5000','10.16.211.22']
3. 重启docker服务
systemctl daemon-reload
systemctl restart docker.service
二、客户端配置:
Macos(其他操作系统需要找到安装docker服务创建的daemon.json配置文件):
vim ~/.docker/daemon.json
{"insecure-registries":["10.16.211.22:5000","10.16.211.22"]}
重启docker服务