“docker pull” certificate signed by unknown authority

后端 未结 8 1974
灰色年华
灰色年华 2020-12-29 04:01

I was trying to pull a docker image from a docker registry but hit the following issue:

$ docker pull //          


        
8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 04:16

    Here is a quick solution:

    • Edit or create the file /etc/docker/daemon.json and add insecure-registries :

    example for docker.squadwars.org:

    {
        "insecure-registries" : ["docker.squadwars.org:443"]
    }
    
    • Restart docker daemon
    systemctl restart docker
    
    • Create a directory with the same name of the host .

    example for docker.squadwars.org:

    mkdir -p /etc/docker/certs.d/docker.squadwars.org
    
    • Get the certificate and save it to the created directory.
    ex +’/BEGIN CERTIFICATE/,/END CERTIFICATE/p’ <(echo | openssl s_client -showcerts -connect docker.squadwars.org:443) -scq > /etc/docker/certs.d/docker.squadwars.org/docker_registry.crt
    

提交回复
热议问题