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

Don't run as root #440

Closed
danp opened this issue Jun 18, 2014 · 5 comments · Fixed by #444
Closed

Don't run as root #440

danp opened this issue Jun 18, 2014 · 5 comments · Fixed by #444

Comments

@danp
Copy link

danp commented Jun 18, 2014

With the current Dockerfile, using docker run as the README suggests means the service runs inside the container as root.

@dmp42 dmp42 added this to the 0.8 milestone Jun 20, 2014
@dmp42
Copy link
Contributor

dmp42 commented Jun 20, 2014

ping @samalba @shin-

How do you see this?
Shall we go with supervisord?

@samalba
Copy link
Contributor

samalba commented Jun 20, 2014

What about adding a simple config to gunicorn to change user: http://docs.gunicorn.org/en/latest/settings.html#user

Since we bind on 5000 by default, it should not be an issue.

What I would do:

From the Dockerfile:

  1. create a registry user
  2. declare a ENV var called DOCKER_REGISTRY_USER that contains this username
  3. From config/gunicorn.py, if the env var exist, I set the user config directive to the right user.

dmp42 pushed a commit that referenced this issue Jun 23, 2014
Docker-DCO-1.1-Signed-off-by: Mangled Deutz <olivier@webitup.fr> (github: dmp42)
@dmp42 dmp42 mentioned this issue Jun 23, 2014
@sirupsen
Copy link

Note that this may not be backwards compatible for some users because of permission issues with local storage.

@bacongobbler
Copy link
Contributor

Note that this may not be backwards compatible for some users because of permission issues with local storage

👍 to elaborate, volume mounts are always mounted with root permissions, so you won't have RW access to the mount unless you explicitly chown the mountpoint.

@dmp42
Copy link
Contributor

dmp42 commented Jun 25, 2014

The mechanism is in place to drop privileges - but yes, there are a number of other considerations to look at before this is ready.

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

Successfully merging a pull request may close this issue.

5 participants