oscarfonts / docker-h2

H2 Dockerfile
https://hub.docker.com/r/oscarfonts/h2/
39 stars 30 forks source link

running as non-root #3

Closed carljmosca closed 7 years ago

carljmosca commented 7 years ago

I am not really familiar with H2 but I have a need to run it in a container. This is a very nice project. I am wondering if there's a reason it needs to run as root. I made some minor changes to run as another user and it seems to run OK.

carljmosca commented 7 years ago

I missed the additional references to port 81 in a couple of the versions and have addressed them in later commits.

oscarfonts commented 7 years ago

It's running as root because that's how I've seen all other Docker scripts work. So I guess it's a common practice. Intuitively, I understand why it should be a good practice not to run things as root, but I wonder why all other images I've seen do it, including the official ones. So, in my limited knowledge, I'd rather follow what I see others do.

Not sure about how to handle the "changeme" password in the script (I mean, that introduces an extra mandatory step -changing the password every time an image is started), and not sure either about write permissions on mounted volumes (have you tested write access to databases?). So far I'm not keen on adding this extra complexity.

So I've decided keep your work in a separate 'non-root' branch, until I learn why it is worth the hassle. :)

Thank you!