Description of problem: Docker-registry does not currently support moving the config file. From the README.md for the project https://github.com/dotcloud/docker-registry: "The location of the yaml file should be relative to the source directory. Absolute paths are not yet supported." So setting the variable $DOCKER_REGISTRY_CONFIG has no effect. Possibly creating a symlink from /etc/docker-registry.yml to /usr/lib/python2.6/site-packages/docker-registry/config.yml in the RPM would be the easiest solution until upstream fixes this issue. Version-Release number of selected component (if applicable): docker-registry-0.6.0-3.el6.noarch How reproducible: Always Steps to Reproduce: 1.Install docker-registry on RHEL 2.Try to start the program 3. Actual results: 2013-12-05 15:15:42 [16957] [ERROR] Exception in worker process: Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker worker.init_process() File "/usr/lib/python2.6/site-packages/gunicorn/workers/ggevent.py", line 165, in init_process super(GeventWorker, self).init_process() File "/usr/lib/python2.6/site-packages/gunicorn/workers/base.py", line 106, in init_process self.wsgi = self.app.wsgi() File "/usr/lib/python2.6/site-packages/gunicorn/app/base.py", line 114, in wsgi self.callable = self.load() File "/usr/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 62, in load return self.load_wsgiapp() File "/usr/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/lib/python2.6/site-packages/gunicorn/util.py", line 354, in import_app __import__(module) File "/usr/lib/python2.6/site-packages/docker-registry/wsgi.py", line 11, in <module> import registry File "/usr/lib/python2.6/site-packages/docker-registry/registry/__init__.py", line 4, in <module> from .app import app File "/usr/lib/python2.6/site-packages/docker-registry/registry/app.py", line 7, in <module> import toolkit File "/usr/lib/python2.6/site-packages/docker-registry/registry/toolkit.py", line 14, in <module> import storage File "/usr/lib/python2.6/site-packages/docker-registry/lib/storage/__init__.py", line 116, in <module> from glance import GlanceStorage File "/usr/lib/python2.6/site-packages/docker-registry/lib/storage/glance.py", line 11, in <module> ...skipping... File "/usr/lib/python2.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/lib/python2.6/site-packages/gunicorn/util.py", line 354, in import_app __import__(module) File "/usr/lib/python2.6/site-packages/docker-registry/wsgi.py", line 11, in <module> import registry File "/usr/lib/python2.6/site-packages/docker-registry/registry/__init__.py", line 4, in <module> from .app import app File "/usr/lib/python2.6/site-packages/docker-registry/registry/app.py", line 7, in <module> import toolkit File "/usr/lib/python2.6/site-packages/docker-registry/registry/toolkit.py", line 14, in <module> import storage File "/usr/lib/python2.6/site-packages/docker-registry/lib/storage/__init__.py", line 116, in <module> from glance import GlanceStorage File "/usr/lib/python2.6/site-packages/docker-registry/lib/storage/glance.py", line 11, in <module> from .local import LocalStorage File "/usr/lib/python2.6/site-packages/docker-registry/lib/storage/local.py", line 5, in <module> import cache File "/usr/lib/python2.6/site-packages/docker-registry/lib/cache.py", line 86, in <module> init() File "/usr/lib/python2.6/site-packages/docker-registry/lib/cache.py", line 23, in init cfg = config.load() File "/usr/lib/python2.6/site-packages/docker-registry/lib/config.py", line 53, in load with open(config_path) as f: IOError: [Errno 2] No such file or directory: '/usr/lib/python2.6/site-packages/docker-registry/lib/../config.yml' Expected results: Program starts Additional info: # At 2013-12-05 17:23:50 in /usr/lib/python2.6/site-packages/docker-registry # root@docker-poc # ln -s /etc/docker-registry.yml /usr/lib/python2.6/site-packages/docker-registry/config.yml # At 2013-12-05 17:23:51 in /usr/lib/python2.6/site-packages/docker-registry # root@docker-poc # service docker-registry restart && tailf /var/log/docker-registry Starting docker-registry: [ OK ] 2013-12-05 17:23:52 [18297] [INFO] Starting gunicorn 18.0 2013-12-05 17:23:52 [18297] [INFO] Listening at: http://0.0.0.0:5000 (18297) 2013-12-05 17:23:52 [18297] [INFO] Using worker: gevent 2013-12-05 17:23:52 [18303] [INFO] Booting worker with pid: 18303 2013-12-05 17:23:52 [18304] [INFO] Booting worker with pid: 18304 2013-12-05 17:23:53 [18305] [INFO] Booting worker with pid: 18305 2013-12-05 17:23:53 [18306] [INFO] Booting worker with pid: 18306 2013-12-05 17:23:53 [18307] [INFO] Booting worker with pid: 18307 2013-12-05 17:23:53 [18308] [INFO] Booting worker with pid: 18308 2013-12-05 17:23:53 [18309] [INFO] Booting worker with pid: 18309 2013-12-05 17:23:53 [18310] [INFO] Booting worker with pid: 18310
Hi Chris, Pelase note that you can specify the configuration file location in the /etc/sysconfig/docker-registry file. Here is the current (default) content of it: =============== # The Docker registry configuration file DOCKER_REGISTRY_CONFIG=/etc/docker-registry.yml # The configuration to use from DOCKER_REGISTRY_CONFIG file SETTINGS_FLAVOR=local # Address to bind the registry to REGISTRY_ADDRESS=0.0.0.0 # Port to bind the registry to REGISTRY_PORT=5000 # Number of workers to handle the connections GUNICORN_WORKERS=8 =============== If you specify the new patch there and restart the service running "service docker restart" should work.
I mean "path", of course :)
Created attachment 833621 [details] etc_sysconfig_docker-registry My /etc/sysconfig/docker-registry file that was in place when the program stack traced and crashed as shown in previous comment.
Created attachment 833632 [details] etc_docker-registry.yml My /etc/docker-registry.yml file that was in place when the program crashed.
Sorry, I misunderstod you. I'll have a fix for you soon.
Hi Marek, I know that you're trying to export the location of the configuration file path as well as the name of the file in the variable $DOCKER_REGISTRY_CONFIG. However, 1) $DOCKER_REGISTRY_CONFIG only refers to the name of the config file and has no relationship with the path to the file 2) The variable get overwritten somewhere along the way regardless so it really doesn't matter what you put in the variable As I said before in comment #1, the application doesn't allow you to change the path from /usr/lib/python2.6/site-packages/docker-registry/ which is clearly documented on their README.md for the project https://github.com/dotcloud/docker-registry: "The location of the yaml file should be relative to the source directory. Absolute paths are not yet supported.". As soon as the application starts up, that variable is thrown out and replaced with /usr/lib/python2.6/site-packages/docker-registry/lib/../config.py . You can see how this happens in the function "def load()" on line 52 in the file /usr/lib/python2.6/site-packages/docker-registry/lib/config.py. I've tested this twice and unless you symlink or copy the file to the location where the application has it hardcoded, the application will not start. Thanks, Chris
Hey Marek, Sorry, I didn't see your comment. Thanks for looking into this. Chris
Please test this scratch build, if it works for you - I'll submit is as an update: http://koji.fedoraproject.org/koji/taskinfo?taskID=6264560 I've decided to patch docker-registry - I added support for absolute paths. I'll send a PR upstream once you confirm that it works as expected. Thanks!
Marek, Spun up a new RHEL 6.5 image in AWS and tested the build and the service came up exactly as expected on first attempt. I would consider this bug fixed. Nice decision to fix for upstream instead of my hackish suggestion. This will benefit a lot of people. Thanks, Chris
Alright, thanks for testing! Once I'll have a PR ready, I'll add the link.
docker-registry-0.6.0-4.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-registry-0.6.0-4.fc19
docker-registry-0.6.0-4.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-registry-0.6.0-4.fc20
docker-registry-0.6.0-4.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-registry-0.6.0-4.el6
Pull request sent! https://github.com/dotcloud/docker-registry/pull/148
Package docker-registry-0.6.0-4.fc20: * should fix your issue, * was pushed to the Fedora 20 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing docker-registry-0.6.0-4.fc20' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-23024/docker-registry-0.6.0-4.fc20 then log in and leave karma (feedback).
docker-registry-0.6.0-4.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
docker-registry-0.6.0-4.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
docker-registry-0.6.0-4.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.