代码之家  ›  专栏  ›  技术社区  ›  Jordi

docker注册表:https而不是http

  •  0
  • Jordi  · 技术社区  · 6 年前

    $ curl -I chart-example.local/v2/                                                                                                                         
    HTTP/1.1 200 OK
    Content-Length: 2
    Content-Type: application/json; charset=utf-8
    Date: Tue, 28 Jan 2020 20:10:35 GMT
    Docker-Distribution-Api-Version: registry/2.0
    Vary: Accept-Encoding
    X-Content-Type-Options: nosniff
    

    但是,当我尝试将本地图像推送到它时,会收到以下消息:

    $ docker push chart-example.local/feedly:latest                                                                                                                                                                                                                                                                          
    The push refers to repository [chart-example.local/feedly]
    Get https://chart-example.local/v2/: x509: certificate has expired or is not yet valid
    

    https 而不是 http

    1 回复  |  直到 6 年前
        1
  •  3
  •   rolaids_guy    6 年前

    Docker默认使用https来保证安全性。您可以通过修改 daemon.json 包含以下内容的文件。做 在生产中使用此设置。

     {
       "insecure-registries" : ["chart-example.local"]
     }
    

    有关详细信息,请参阅此链接: https://docs.docker.com/registry/insecure/