docker login : x509: certificate signed by unknown authority

一. 背景

docker login 登录harbor镜像仓库报错.

[root@master01 sloth]# docker login docker.harbor.master01.com
Username: bigdata
Password:
Error response from daemon: Get https://docker.harbor.master01.com/v2/: x509: certificate signed by unknown authority
[root@master01 sloth]#

二. 解决方式

  1. 修改docker配置文件, 将访问的镜像仓库地址加入到docker的/etc/docker/daemon.json配置中. 新增参数 insecure-registries.
[root@master01 sloth]# more /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2",
  "insecure-registries": ["docker.harbor.master01.com", "要忽略的image仓库请求地址"]
}
  1. 重启docker服务

systemctl restart docker

  1. 登录
[root@master01 sloth]# docker login   docker.harbor.master01.com
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@master01 sloth]#

你可能感兴趣的:(k8s,kubernetes)