Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Issue with DOCKER_REGISTRY_CONFIG var #332

Closed
ProbablyRusty opened this issue Apr 30, 2014 · 8 comments
Closed

Issue with DOCKER_REGISTRY_CONFIG var #332

ProbablyRusty opened this issue Apr 30, 2014 · 8 comments
Labels
Milestone

Comments

@ProbablyRusty
Copy link
Contributor

If I mount a config file into the docker image as exemplified in the README:

sudo docker run -p 5000:5000 -v /home/user/registry-conf:/registry-conf -e DOCKER_REGISTRY_CONFIG=/registry-conf/config.yml registry

...the run fails as follows:

./setup-configs.sh: line 14: config/config.yml: No such file or directory
** [Bugsnag] No API key configured, couldn't notify
Traceback (most recent call last):
File "/usr/local/bin/docker-registry", line 9, in
load_entry_point('docker-registry==0.6.8', 'console_scripts', 'docker-registry')()
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 351, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2363, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2088, in load
File "/usr/local/lib/python2.7/dist-packages/docker_registry/init.py", line 16, in
from .app import app
File "/usr/local/lib/python2.7/dist-packages/docker_registry/app.py", line 12, in
from . import toolkit
File "/usr/local/lib/python2.7/dist-packages/docker_registry/toolkit.py", line 15, in
from . import storage
File "/usr/local/lib/python2.7/dist-packages/docker_registry/storage/init.py", line 133, in
from local import LocalStorage
File "/usr/local/lib/python2.7/dist-packages/docker_registry/storage/local.py", line 5, in
from ..lib import cache_lru
File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/cache_lru.py", line 85, in
init()
File "/usr/local/lib/python2.7/dist-packages/docker_registry/lib/cache_lru.py", line 34, in init
port=int(redis_opts['port']),
ValueError: invalid literal for int() with base 10: '!ENV_NOT_FOUND'

Seems like ./setup-configs.sh isn't aware of DOCKER_REGISTRY_CONFIG?

@dmp42
Copy link
Contributor

dmp42 commented May 5, 2014

Hello @consultantRR

setup-configs.sh indeed is not aware of DOCKER_REGISTRY_CONFIG

Anyhow, this is NOT your issue here. Rather, it's telling you that the environment variable CACHE_REDIS_PORT is not set - which means that you have set SETTINGS_FLAVOR to prod and using a copy of the sample file.

Admittedly, this is a mess.

Now, trying to solve your problem:

  • are you sure you want to run out of the "prod" settings?
  • if so, then you must review your configuration, specially the LRU/Redis configuration

Please keep me updated on how it goes.

Best.

@dmp42 dmp42 added the question label May 5, 2014
@dmp42 dmp42 added this to the 0.7 milestone May 5, 2014
@dmp42 dmp42 self-assigned this May 5, 2014
@dmp42
Copy link
Contributor

dmp42 commented May 16, 2014

I believe this is fixed with the configuration cleanup at #350 that just got merged. You can expect a way better situation with the upcoming 0.7 version.

I'm going to close this ticket, but feel free to comment here if you are still having issues with the current configuration mechanism.

Best.

@dmp42 dmp42 closed this as completed May 16, 2014
@pmyjavec
Copy link

Wow, this thread can be hard to follow. It sounds like you cannot set the configuration at all.

@dmp42
Copy link
Contributor

dmp42 commented May 28, 2014

@pmyjavec what is?

@pmyjavec
Copy link

@dmp42Well, It seems from what I'm experiencing and what you've said above this is pretty much unusable unless we use what is in the sample config right?

I would love to be proven wrong right now.

How does one possibly set the configuration if DOCKER_REGISTRY_CONFIG is ignored?

I'm also having no luck at all setting environment variables either BTW.

@dmp42
Copy link
Contributor

dmp42 commented May 28, 2014

@dmp42Well, It seems from what I'm experiencing and what you've said above this is pretty much unusable unless we use what is in the sample config right?

I don't think so.

I would love to be proven wrong right now.

Yes, you are wrong.

Just use:

sudo docker run -p 5000:5000 -v /home/user/whateverconfigfolder:/registry-conf -e DOCKER_REGISTRY_CONFIG=/registry-conf/mysuperconf.yml registry

And disregard entirely what setup-configs.sh says, as it doesn't matter.

Or run from master (which is pretty much 0.7, to be released in a matter of hours now), and disregard this ticket (and the others as well) entirely.

If you still have issues (with either 0.6.x or 0.7 and need help), I would be glad to help indeed, but I would need something more specific than "wow this is absolutely stoopid" :-)

Best.

@pmyjavec
Copy link

Updated my comment ;)

Thanks for the help, will try again.

@dmp42
Copy link
Contributor

dmp42 commented May 28, 2014

Wow, this thread can be hard to follow.

Yes, the original poster (@consultantRR) thought his problem was with setup-config.sh, while it was not, which made this more confusing than needed.

How does one possibly set the configuration if DOCKER_REGISTRY_CONFIG is ignored?

DOCKER_REGISTRY_CONFIG is NOT ignored by the registry code. Whatever it points to WILL be used by the registry code: https://github.com/dotcloud/docker-registry/blob/0.6.9/docker_registry/lib/config.py#L58

DOCKER_REGISTRY_CONFIG IS ignored by the (legacy, broken, useless, and removed :-)) setup-config.sh script, though.

I'm also having no luck at all setting environment variables either BTW.

Ok, can you copy me (here or gist) the command line you use to launch the registry, and possibly the content of your config file?

Hope that helps

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants