kwk / docker-registry-frontend

Browse and modify your Docker registry in a browser.
https://registry.hub.docker.com/u/konradkleine/docker-registry-frontend/
MIT License
1.68k stars 616 forks source link

Repositories are not showing up #170

Closed cschlaefcke closed 7 years ago

cschlaefcke commented 7 years ago

Hi,

I am trying to setup a custom docker registry server and would also like to access the content of the registry via browser. First I stumbled upon Philipp Wintermantel´s Blog and from there I followed the link to this project. The core registry is up and running so far but I was neither able to get the frontend part running from Philipp´s blog nor from the example-setup here.

The frontend actually starts but when I push for example the busybox image to the registry it will not show up in the frontend.

[centos-linux-7 ~]# docker pull busybox
[centos-linux-7 ~]# docker tag busybox localhost:5000/busybox
[centos-linux-7 ~]# docker push localhost:5000/busybox

I double checked by connecting to the registry container having a look in the registry storage location:

/var/lib/registry/docker/registry/v2 # ls -l
total 8
drwxr-xr-x    3 root     root          4096 Jul 22 07:53 blobs
drwxr-xr-x    3 root     root          4096 Jul 22 07:53 repositories
/var/lib/registry/docker/registry/v2 # cd repositories/
/var/lib/registry/docker/registry/v2/repositories # ls -l
total 4
drwxr-xr-x    5 root     root          4096 Jul 22 07:53 busybox

I started the registry like this: [centos-linux-7 ~]# docker run -d --name registry -p 5000:5000 -e SEARCH_BACKEND=sqlalchemy -e STORAGE_PATH=/registry registry

and the frontend like this: [centos-linux-7 ~]# docker run -d --name registry-frontend -e ENV_DOCKER_REGISTRY_HOST=localhost -e ENV_DOCKER_REGISTRY_PORT=5000 -p 8080:80 konradkleine/docker-registry-frontend:v2

The only thing I wonder is why the actual storage path from the config.yml /var/lib/registry expands to /var/lib/registry/docker/registry in the container. Does this maybe point to a misconfiguration or incompatibility somehow?

I am running:

[centos-linux-7 ~]# docker --version
Docker version 1.12.6, build 88a4867/1.12.6

on

[centos-linux-7 ~]# uname -a
Linux centos-linux-7.shared 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

docker-registry-frontend version:

[centos-linux-7 ~]# docker images | grep "docker-registry-frontend"
docker.io/konradkleine/docker-registry-frontend   v2                  46d746fdd429        2 weeks ago         264.5 MB

I hope that someone can point me to the right direction. Any hint would be very much appreciated.

Best regards,

Christian

cschlaefcke commented 7 years ago

I just found the logs :-)

[Tue Jul 25 06:06:03.415795 2017] [proxy:error] [pid 39:tid 140161694299904] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:5000 (localhost) failed
[Tue Jul 25 06:06:03.415855 2017] [proxy:error] [pid 39:tid 140161694299904] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[Tue Jul 25 06:06:03.415862 2017] [proxy_http:error] [pid 39:tid 140161694299904] [client 172.17.0.1:41502] AH01114: HTTP: failed to make connection to backend: localhost, referer: http://localhost:8080/repositories/

Looks like the frontend cannot reach the backend - no idea why :-(

Selinux is set to permissive by the way

cschlaefcke commented 7 years ago

Argh - got it :-)

Actually pointing to the registry with localhost does not seem to be so clever. Fixed by linking the registry to the frontend and referring to ENV_DOCKER_REGISTRY_HOST=registry instead of ENV_DOCKER_REGISTRY_HOST=localhost finally let my repository appear :-)

centos-linux-7 ~]# docker run -d --name registry-frontend --link registry -e ENV_DOCKER_REGISTRY_HOST=registry -e ENV_DOCKER_REGISTRY_PORT=5000 -p 8080:80 konradkleine/docker-registry-frontend:v2