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

Duplicate settings for which port to bind to for HTTP #368

Closed
jlhawn opened this issue May 16, 2014 · 4 comments
Closed

Duplicate settings for which port to bind to for HTTP #368

jlhawn opened this issue May 16, 2014 · 4 comments
Milestone

Comments

@jlhawn
Copy link

jlhawn commented May 16, 2014

The README assumes you want to run it on port 5000, but say I want to run it on port 80? There appears to be no setting in the config.yml file for this. I searched for where the server starts listening for connections but it looks like there are at least 3 different places which try to configure this and it's quite confusing:

  1. docker_registry/wsgi.py
    looks like this file says you can set a PORT_WWW environment variable defaulting to 5000, but this is only if you run this file directly from the command line, so this must not be what the Docker container uses when it starts.
  2. config/gunicorn_config.py
    I'm not sure how you start the server using this config file, but it uses PORT_WWW as well, but defaults to 8000 instead, wut?
  3. docker_registry/__init__.py
    Starting from the Dockerfile, it looks like we pip install the /docker_registry/ directory. The setup.py file specifies docker-registry as a console script which runs docker_registry:run_gunicorn. Reading docker_registry/__init__.py it uses REGISTRY_PORT and defaults to 5000. It also does os.execl on the gunicorn executable path and specifies a bunch of command line options. Why not just specify the config/gunicorn_config.py module instead?

In conclusion, it looks like REGISTRY_PORT is the correct environment variable to use to change the server port. Let's make that more obvious, clean, and consistent.

@samalba
Copy link
Contributor

samalba commented May 16, 2014

Also it looks like introducing the docker_registry package and the run_gunicorn method replicated the way gunicorn is launched and configured.

I like using config/gunicorn_config.py actually...

@jlhawn
Copy link
Author

jlhawn commented May 16, 2014

also in the Dockerfile: CMD exec docker-registry seems strange. Why not just CMD docker-registry?

@samalba
Copy link
Contributor

samalba commented May 16, 2014

I think it's just to avoid keeping a sh child process... Maybe docker should do that directly.

@dmp42 dmp42 added this to the 0.7 milestone May 17, 2014
@wking
Copy link
Contributor

wking commented May 20, 2014

On Fri, May 16, 2014 at 04:00:59PM -0700, Sam Alba wrote:

I think it's just to avoid keeping a sh child process...

Yup, see c170cc5 (Use exec to eliminate extra shell processes,
2014-03-01).

Maybe docker should do that directly.

You can do that with ENTRYPOINT, but I prefer 'CMD exec …' when
/bin/sh exists because it makes it easier to launch an interactive
session when you want to poke things before launching the registry.

@dmp42 dmp42 modified the milestones: 0.8, 0.7 May 23, 2014
dmp42 pushed a commit that referenced this issue May 29, 2014
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <[email protected]> (github: dmp42)
@dmp42 dmp42 mentioned this issue May 29, 2014
@dmp42 dmp42 mentioned this issue May 30, 2014
@dmp42 dmp42 closed this as completed in 4963f28 Jun 2, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants