docker-compose down -v:停止并移除整个project的所有services
代码语言:javascript复制[root@localhost harbor]# docker-compose down -vStopping harbor-jobservice ... doneStopping nginx ... doneStopping harbor-ui ... doneStopping redis ... done查找docker.service所在位置:代码语言:javascript复制[root@localhost harbor]# find / -name docker.service -type f/usr/lib/systemd/system/docker.service修改docker.service配置文件:添加 --insecure-registry=192.168.2.195 配置
代码语言:javascript复制[root@localhost harbor]# vim /usr/lib/systemd/system/docker.service[Unit]Documentation=http://docs.docker.io //需修改...[Service]Type=notify# the default is not to use systemd for cgroups because the delegate issues still# exists and systemd currently does not support the cgroup feature set required# for containers run by docker# ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sockExecStart=/usr/bin/dockerd --insecure-registry=192.168.2.195 //重要ExecStartPost=/sbin/iptables -I FORWARD -s 0.0.0.0/0 -j ACCEPT //需修改,根据自己的docker路径跟IP地址进行修改ExecReload=/bin/kill -s HUP $MAINPIDTimeoutSec=0RestartSec=2Restart=always...[Install]WantedBy=multi-user.target重启服务:代码语言:javascript复制[root@localhost harbor]# systemctl daemon-reload[root@localhost harbor]# systemctl restart docker启动harbor:docker-compose up -d :构建(容器)并启动(容器)整个project的所有service
代码语言:javascript复制[root@localhost harbor]# docker-compose up -dCreating network "harbor_harbor" with the default driverCreating harbor-log ... doneCreating registry ... doneCreating redis ... doneCreating harbor-db ... doneCreating harbor-adminserver ... doneCreating harbor-ui ... doneCreating nginx ... doneCreating harbor-jobservice ... done查看服务:已经包含了 --insecure-registry=192.168.2.195 参数
代码语言:javascript复制[root@localhost harbor]# ps -aux | grep docker...root 40719 1.4 4.8 660304 79992 ? Ssl 01:58 0:14 /usr/bin/dockerd --insecure-registry=192.168.2.195...测试登录:代码语言:javascript复制[root@localhost harbor]# docker login 192.168.2.195Username: adminPassword: WARNING! Your password will be stored unencrypted in /root/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded //登录成功成功登录!