开发者社区> 问答> 正文

windows 7下,docker怎么访问私有库

设置/var/lib/boot2docker/profile 无效

小编只是大自然的搬运工,本问答整理自阿里技术天团正在解答Docker技术难题

展开
收起
管理贝贝 2016-07-13 17:36:40 4990 0
1 条回答
写回答
取消 提交回答
  • 静静的看着你们

    需要在/var/lib/boot2docker/profile中添加--insecure-registry的配置,修改后需要重启docker的服务,可以执行sudo /etc/init.d/docker restart 或者直接docker-machine restart {machine name}


    【 curl http://139.198.2.55:5000/v1/search】能成功
    【docker search 139.198.2.55:5000/nginx】显示如下
    Error response from daemon: invalid registry endpoint https://139.198.2.55:5000/v1/: Get https://139.198.2.55:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add --insecure-registry 139.198.2.55:5000 to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/139.198.2.55:5000/ca.crt


    回复@豆豆爸:
    你需要配置--insecure-registry到配置文件,请参考下我下面用你这个仓库的配置方式:

    docker@test1:~$ sudo vi /var/lib/boot2docker/profile
    docker@test1:~$ cat /var/lib/boot2docker/profile
    
    EXTRA_ARGS='
    --label provider=virtualbox
    --insecure-registry 139.198.2.55:5000
    '
    CACERT=/var/lib/boot2docker/ca.pem
    DOCKER_HOST='-H tcp://0.0.0.0:2376'
    DOCKER_STORAGE=aufs
    DOCKER_TLS=auto
    SERVERKEY=/var/lib/boot2docker/server-key.pem
    SERVERCERT=/var/lib/boot2docker/server.pem
    
    
    docker@test1:~$ sudo /etc/init.d/docker restart
    Need TLS certs for test1,127.0.0.1,10.0.2.15,192.168.99.100
    -------------------
    docker@test1:~$ docker search 139.198.2.55:5000/nginx
    NAME            DESCRIPTION   STARS     OFFICIAL   AUTOMATED
    library/nginx                 0
    2019-07-17 19:55:55
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
应用 Docker 进行持续交付:用技术改变交付路程 立即下载
从Docker到容器服务 立即下载
构建基因数据应用生态系统—— docker in Bio/informatics 立即下载