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

[Question] Container running as non-root? #87

Open
GuyMight44 opened this issue Apr 13, 2020 · 3 comments
Open

[Question] Container running as non-root? #87

GuyMight44 opened this issue Apr 13, 2020 · 3 comments
Labels

Comments

@GuyMight44
Copy link

GuyMight44 commented Apr 13, 2020

Hi, can the container run as a non-root user? For example, at the end of the Dockerfile, could I add:
RUN useradd -m myuser
USER myuser
before the "CMD" line

And MySQL would run fine? Or will the container complain about not having root?

@mattrayner
Copy link
Owner

mattrayner commented Apr 13, 2020 via email

@GuyMight44
Copy link
Author

Hi, there is a reason I wanted to see if I can run as root.

I am trying to build a dockerfile for Heroku but there are some restrictions as Heroku does not allow containers to run as root. https://devcenter.heroku.com/articles/container-registry-and-runtime#testing-an-image-locally

Thing is, I dont know how to modify mysql to work under non-root conditions if its even possible. I understand this is for local development but I was hoping maybe there would be a way since it would help me develop locally then I could push the image to Heroku

@mattrayner
Copy link
Owner

Hi @GuyMight44, I will have a think about this and get back to you :)

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

No branches or pull requests

2 participants