Page MenuHomePhabricator

Can't docker pull from docker-registry.discovery.wmnet
Closed, DeclinedPublic

Description

Given a Dockerfile.template having:

FROM {{ registry }}/wikimedia-stretch

The Dockerfile has:

FROM docker-registry.discovery.wmnet/wikimedia-stretch

However trying to pull it yields:

$ docker pull docker-registry.discovery.wmnet/wikimedia-stretch
Using default tag: latest
Error response from daemon: Get https://docker-registry.discovery.wmnet/v2/wikimedia-stretch/manifests/latest: no basic auth credentials

But it works via the public endpoint:

$ docker pull docker-registry.wikimedia.org/wikimedia-stretch:latest
latest: Pulling from wikimedia-stretch
dea2308223aa: Already exists 
Digest: sha256:e4da20099693c34ff780ed0766880e74ce3f479699bac51f212d57879b785a5b
Status: Downloaded newer image for docker-registry.wikimedia.org/wikimedia-stretch:latest

From docker-pkg output:

2017-12-20 09:43:01,136 [docker-pkg-build] DEBUG - Looking for auth config (build.py:263)
2017-12-20 09:43:01,136 [docker-pkg-build] DEBUG - No auth config in memory - loading from filesystem (build.py:268)
2017-12-20 09:43:01,136 [docker-pkg-build] DEBUG - Trying paths: ['/home/hashar/.docker/config.json', '/home/hashar/.dockercfg'] (auth.py:234)
2017-12-20 09:43:01,136 [docker-pkg-build] DEBUG - No config file found (auth.py:241)
2017-12-20 09:43:01,136 [docker-pkg-build] DEBUG - No auth config found (build.py:308)
2017-12-20 09:43:01,221 [docker-pkg-build] DEBUG - http://localhost:None "POST /v1.30/build?pull=False&forcerm=False&rm=True&nocache=True&q=False&t=docker-registry.discovery.wmnet%2Freleng%2Fcastor%3A0.1.1...
2017-12-20 09:43:01,230 [docker-pkg-build] ERROR - Building image docker-registry.discovery.wmnet/releng/castor:0.1.1 failed - check your Dockerfile: Get https://docker-registry.discovery.wmnet/v2/wikimedia-stretch/manifests/latest: no basic auth credentials (image.py:228)
...
docker.errors.BuildError: Get https://docker-registry.discovery.wmnet/v2/wikimedia-stretch/manifests/latest: no basic auth credentials

Event Timeline

hashar created this task.Dec 20 2017, 9:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 20 2017, 9:50 AM

Change 399366 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] docker: point Castor FROM to the public registry

https://gerrit.wikimedia.org/r/399366

hashar updated the task description. (Show Details)Dec 20 2017, 9:55 AM

Change 399366 merged by jenkins-bot:
[integration/config@master] docker: point Castor FROM to the public registry

https://gerrit.wikimedia.org/r/399366

hashar closed this task as Declined.Dec 21 2017, 8:12 PM

I think that is properly solved by switching all images`FROM` to the jinja template:

FROM {{ "ci-stretch" | image_tag }}

docker-pkg then figure out the full name (regitry + tag) of the dependent image. Based on the yaml configuration file that set the registry and on the changelog of each of the images.