doudizhu2222 2017-01-10 01:03
浏览 495

Docker身份验证URL的TLS自签名证书

I am trying to log in to the Docker registry you build with the oadm tool. I attempt to log in using a token:

# docker login -u $(oc whoami) -e 'xxxx' -p $(oc whoami -t) 172.30.10.52:5000
Error response from daemon: no successful auth challenge for   
https://172.30.10.52:5000/v2/ - errors: [basic auth attempt to 
https://172.30.10.52:5000/v2/ realm "openshift" failed with status: 400 Bad 
Request]

Looking in the logs, I can see that the problem is because my instance uses a self-signed certificate:

time="2017-01-10T00:58:42.913539516Z" level=error msg="error authorizing context: 
Get https://ld7-zko8s6q-ws:8443/oapi/v1/users/~: x509: 
certificate signed by unknown authority" 
go.version=go1.4.2 http.request.host="172.30.10.52:5000" 
http.request.id=3fa81975-3aa9-44d8-a6a8-c00ad360009c 
http.request.method=GET http.request.remoteaddr="10.1.0.1:49316" 
http.request.uri="/v2/" http.request.useragent="docker/1.10.3 go/go1.6.2 
git-commit/429be27-unsupported kernel/3.10.0-514.2.2.el7.x86_64 
os/linux arch/amd64" instance.id=2a23b229-2a0e-4734-83c4-38cb9c8a0e00 

How can I either get my certificate to be trusted or to turn off TLS verification?

  • 写回答

1条回答 默认 最新

  • dongli2000 2017-01-10 05:30
    关注

    You could test an insecure registry by adding

    DOCKER_OPTS="--insecure-registry myregistrydomain.com:5000"
    

    to your /etc/default/docker file or /etc/sysconfig/docker file

    But it is best to add your self-signed certificate to /etc/docker/certs.d/myregistrydomain.com:5000/ca.crt. And restart your Docker daemon.
    That way, it will trust your certificate.

    Note that Openshift origin has a currently open issue 1753 "Need mechanism for registering certs for private docker registries" See also "Can not pull image from remote node #6228" referring to the Openshift official documentation "Securing and Exposing the Registry".

    评论

报告相同问题?

悬赏问题

  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行