fi
check_for_cleanup
if ! [ -f $pidfile ]; then
prestart
printf "Starting $prog:t"
echo "n$(date)n" >> $logfile
## addDOCKER_OPTS
$exec -d $DOCKER_OPTS &>> $logfile &
pid=$!
touch $lockfile
# waitup to 10 seconds for the pidfile to exist. see
#https://github.com/docker/docker/issues/5359
tries=0
while [ ! -f $pidfile -a $tries -lt 10 ]; do
sleep 1
tries=$((tries + 1))
done
success
echo
else
failure
echo
printf "$pidfile still exists...n"
exit 7
fi
}
⑶ 重启docker并验证pull功能
[root@123 ] # service docker restart⑷其他方法
不这么费事,直接修改启动项,原理和结果都是相同的,然后重启dockerdaemon
[root@123 ] # vi /etc/init.d/docker## 找到exec,直接添加--insecure-registry ip:port
prog="docker"
exec="/usr/bin/$prog --insecure-registryip:port"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
logfile="/var/log/$prog"
2、Docker CE版本
检查/etc/docker目录下是否有daemon.json文件,如果没有则创建,或者直接vi/etc/docker/daemon.json修改完在:wq也行。
[root@123 ] # vi /etc/docker/daemon.json## add
{
"registry-mirrors": ["https://registry.docker-cn.com"],
"insecure-registries" : ["ip:port","ip:port"]
}
添加完成后重启docker服务
service docker restart您可能感兴趣的文章:详解基于docker 如何部署surging分布式微服务引擎阿里云Linux CentOS 7 Docker部署使用gogs搭建自己的git服务器ubuntu服务器上快速部署docker的方法










