{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/Dragonfly/issues/17","repository_url":"https://api.github.com/repos/alibaba/Dragonfly","labels_url":"https://api.github.com/repos/alibaba/Dragonfly/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/Dragonfly/issues/17/comments","events_url":"https://api.github.com/repos/alibaba/Dragonfly/issues/17/events","html_url":"https://github.com/alibaba/Dragonfly/issues/17","id":281996291,"number":17,"title":"How to support docker private registry.","user":{"login":"lifubang","id":783424,"avatar_url":"https://avatars1.githubusercontent.com/u/783424?v=4","gravatar_id":"","url":"https://api.github.com/users/lifubang","html_url":"https://github.com/lifubang","followers_url":"https://api.github.com/users/lifubang/followers","following_url":"https://api.github.com/users/lifubang/following{/other_user}","gists_url":"https://api.github.com/users/lifubang/gists{/gist_id}","starred_url":"https://api.github.com/users/lifubang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifubang/subscriptions","organizations_url":"https://api.github.com/users/lifubang/orgs","repos_url":"https://api.github.com/users/lifubang/repos","events_url":"https://api.github.com/users/lifubang/events{/privacy}","received_events_url":"https://api.github.com/users/lifubang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-14T06:36:59Z","updated_at":"2018-03-06T02:42:26Z","closed_at":null,"author_association":"NONE","body":"I have a docker registry: docker.acmcoder.com. There are several public and private images in it.\r\nI want to use dragonfly for image distribution.\r\nAfter deploy, the public images can be pulled. but private images can not.\r\n\r\n```\r\ndf-daemon:\r\ndf-daemon --registry https://docker.acmcoder.com -port 18001\r\n```\r\n```\r\ndockerd\r\nroot@iZ2ze7tbgo9lk7jubiy6tcZ:~# cat /etc/docker/daemon.json\r\n{\r\n  \"registry-mirrors\": [\"http://localhost:18001\"]\r\n}\r\n```\r\n```\r\nroot@iZ2ze7tbgo9lk7jubiy6tcZ:~# docker pull acmcoder/ubuntu:12days\r\nError response from daemon: repository acmcoder/ubuntu not found: does not exist or no pull access\r\n\r\nroot@iZ2ze7tbgo9lk7jubiy6tcZ:~# docker pull docker.acmcoder.com/acmcoder/ubuntu:12days\r\n12days: Pulling from acmcoder/ubuntu\r\n054be6183d06: Pull complete \r\n779578d7ea6e: Pull complete \r\n82315138c8bd: Pull complete \r\n88dc0000f5c4: Pull complete \r\n79f59e52a355: Pull complete \r\na0b39032ccd2: Pull complete \r\n46c56af51e55: Pull complete \r\n1ee150f4e54b: Pull complete \r\nead87fbf844e: Pull complete \r\nbaa460bf3866: Pull complete \r\n0dd037bb5aaa: Pull complete \r\nDigest: sha256:3b1428d54bc875ff75eb8f0379516cbd04bb5e09b37024db4ac3bff574b88c7d\r\nStatus: Downloaded newer image for docker.acmcoder.com/acmcoder/ubuntu:12days\r\n```\r\n\r\ndockerd log:\r\nERRO[2258] Not continuing with pull after error: errors:\r\ndenied: requested access to the resource is denied\r\nunauthorized: authentication required\r\n \r\nINFO[2258] Ignoring extra error returned from registry: unauthorized: authentication required \r\nINFO[2258] Translating \"denied: requested access to the resource is denied\" to \"repository acmcoder/ubuntu not found: does not exist or no pull access\" \r\nERRO[2258] Handler for POST /v1.26/images/create returned error: repository acmcoder/ubuntu not found: does not exist or no pull access \r\n\r\nAfter I use docker login localhost:18001\r\nIt still can't work."},"comment":{"url":"https://api.github.com/repos/alibaba/Dragonfly/issues/comments/370642567","html_url":"https://github.com/alibaba/Dragonfly/issues/17#issuecomment-370642567","issue_url":"https://api.github.com/repos/alibaba/Dragonfly/issues/17","id":370642567,"user":{"login":"chenchaobing","id":9857855,"avatar_url":"https://avatars0.githubusercontent.com/u/9857855?v=4","gravatar_id":"","url":"https://api.github.com/users/chenchaobing","html_url":"https://github.com/chenchaobing","followers_url":"https://api.github.com/users/chenchaobing/followers","following_url":"https://api.github.com/users/chenchaobing/following{/other_user}","gists_url":"https://api.github.com/users/chenchaobing/gists{/gist_id}","starred_url":"https://api.github.com/users/chenchaobing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenchaobing/subscriptions","organizations_url":"https://api.github.com/users/chenchaobing/orgs","repos_url":"https://api.github.com/users/chenchaobing/repos","events_url":"https://api.github.com/users/chenchaobing/events{/privacy}","received_events_url":"https://api.github.com/users/chenchaobing/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T02:42:26Z","updated_at":"2018-03-06T02:42:26Z","author_association":"CONTRIBUTOR","body":"对于私有仓库，执行 docker pull acmcoder/ubuntu:12days 和 docker pull docker.acmcoder.com/acmcoder/ubuntu:12days 中间有一些区别。\r\n主要的区别在于：\r\n通过docker pull docker.acmcoder.com/acmcoder/ubuntu:12days 的方式，在获取token的时候，会带上docker login时输入的账号信息account=admin（如account：admin）,且会在header中通过authorization传递login时输入的账号和密码。\r\n所以通过docker pull docker.acmcoder.com/acmcoder/ubuntu:12days方式可以正常获取到镜像，而通过docker pull acmcoder/ubuntu:12days的方式无法获取。\r\n\r\n有一种解决方案是，可以把df-daemon作为proxy的方式，需要把df-daemon配置为proxy而不是mirror。目前的df-daemon支持http的proxy方式，对于自己搭建的通过http协议访问的harbor registry，可以通过这种方式。对于 docker.acmcoder.com 目前还无法支持，需要扩展df-daemon的https proxy功能才能支持。\r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"chenchaobing"}}