Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the image as non-root user #243

Closed
raphaelokon opened this issue Oct 17, 2017 · 3 comments
Closed

Run the image as non-root user #243

raphaelokon opened this issue Oct 17, 2017 · 3 comments

Comments

@raphaelokon
Copy link

Hi there,

is it possible to run this image as a non-root user inside the container? I tried to run it with www-data on Docker for Mac but got errors (apache was complaining) in the logs

@tianon
Copy link
Member

tianon commented Oct 17, 2017

By default it binds to port 80, so trying to run it with --user www-data is going to run into moby/moby#8460 unless that port is changed (or one of the other workarounds described there is used, which if your kernel is new enough could be simply --sysctl net.ipv4.ip_unprivileged_port_start=0).

@raphaelokon
Copy link
Author

Thanks @tianon Ah great. So I could just change the bound port inside the container to run as non-root then?

@tianon
Copy link
Member

tianon commented Jan 10, 2018

Sorry for the delay.

Yes, changing the port is one easy way to accomplish this. Using --sysctl net.ipv4.ip_unprivileged_port_start=0 is another.

See also #249 for a bit of functionality the image gained since this was filed which can also be used to trivially switch which user it ends up running as.

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

No branches or pull requests

2 participants