博客列表 >ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)

ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)

哈
原创
2022年07月12日 10:34:37663浏览

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

问题:搭建私库认证不通过x509: certificate signed by unknown authority

首先确保配置harbor私库地址

  1. [root@master harbor]# grep hostname harbor.cfg
  2. #The IP address or hostname to access admin UI and registry service.
  3. hostname = hub.bingo.com

方法一:/etc/docker/daemon.json,添加私库地址

  1. {
  2. "insecure-registries":["私库地址"]
  3. }

方法二:vim /usr/lib/systemd/system/docker.service

  1. ExecStart=/usr/bin/dockerd --insecure-registry 私库地址

[root@master data]# systemctl daemon-reload
[root@master data]# systemctl restart docker
[root@master data]# docker info

修改完成后输入,doucker info查看下

  1. Registry: https://index.docker.io/v1/
  2. Labels:
  3. Experimental: false
  4. Insecure Registries:
  5. hub.bingo.com #这个地址,做解析
  6. 127.0.0.0/8
  7. Live Restore Enabled: false

注意:如果是域名形式,记得修改下hosts文件,解析下
ps:多个节点共享同一个harbor仓库,需配置私有仓库地址以及将主节点的认证文件传递到其他节点的相同目录下scp -r /data/cert/ root@node1:/data/cert/,配置重启即可

docker莫名启动不了,查看状态发现如下原因,

  1. [root@master system]# systemctl status docker.service
  2. docker.service - Docker Application Container Engine
  3. Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
  4. Active: failed (Result: start-limit) since Fri 2021-12-31 11:35:48 +08; 14s ago
  5. Docs: https://docs.docker.com
  6. Process: 17557 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)
  7. Main PID: 17557 (code=exited, status=1/FAILURE)
  8. Dec 31 11:35:47 master systemd[1]: Failed to start Docker Application Container Engine.
  9. Dec 31 11:35:47 master systemd[1]: Unit docker.service entered failed state.
  10. Dec 31 11:35:47 master systemd[1]: docker.service failed.
  11. Dec 31 11:35:48 master systemd[1]: docker.service holdoff time over, scheduling restart.
  12. Dec 31 11:35:48 master systemd[1]: Stopped Docker Application Container Engine.
  13. Dec 31 11:35:48 master systemd[1]: start request repeated too quickly for docker.service
  14. Dec 31 11:35:48 master systemd[1]: Failed to start Docker Application Container Engine.
  15. Dec 31 11:35:48 master systemd[1]: Unit docker.service entered failed state.
  16. Dec 31 11:35:48 master systemd[1]: docker.service failed.

解决方法:

若配置了国内加载镜像,镜像文件为/etc/docker/daemon.json,则修改文件后缀为.conf即可正常启动docker 服务

  1. [root@master data]# docker login -u admin -p Harbor12345 hub.bingo.com
  2. WARNING! Using --password via the CLI is insecure. Use --password-stdin.
  3. WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
  4. Configure a credential helper to remove this warning. See
  5. https://docs.docker.com/engine/reference/commandline/login/#credentials-store
  6. Login Succeeded

可以愉快的玩耍了

https认证:

  1. cd/data/cert/
  2. openssl genrsa -des3 -out server.key 2048 #创建私钥
  3. openssl req -new -key server.key -out server.csr #发起请求
  4. cp server.key server.key.org #备份私钥
  5. openssl rsa -in server.key.org -out server.key #转化证书
  6. openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt #签名
  7. chmod-R777/data/cert

原文链接:https://blog.csdn.net/weixin_45961525/article/details/122253256

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议