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

Container running as root #87

Closed
JordanP opened this issue Sep 15, 2020 · 4 comments
Closed

Container running as root #87

JordanP opened this issue Sep 15, 2020 · 4 comments

Comments

@JordanP
Copy link

JordanP commented Sep 15, 2020

Hi,
Is there a reason with the container is running as root ?

It looks like the Dockeerfile (https://github.com/pganalyze/collector/blob/master/Dockerfile#L4) is adding a user but no "USER" directive, that user is not actually used.

@JordanP
Copy link
Author

JordanP commented Sep 15, 2020

Hum, actually it's using gosu. Why not just use "USER" in the Dockerfile ? Problem is, anybody that can "exec" into the container is actually "root".

@lfittl
Copy link
Member

lfittl commented Nov 1, 2020

@JordanP I think this is mostly for historic reasons, since Docker didn't always support running the container as non-root. We'll review whether we can move away from the gosu-based approach, and instead use the USER command.

We would of course also welcome a patch for this, if you'd like.

@lfittl
Copy link
Member

lfittl commented Apr 7, 2021

@JordanP FYI, we have a test image available at #174 that uses USER instead of gosu for the privilege drop. It would be great if you can give that a look and see whether it works for your environment.

@lfittl
Copy link
Member

lfittl commented Apr 16, 2021

Closing based on #174 being merged.

@lfittl lfittl closed this as completed Apr 16, 2021
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