You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #253, this image supports running as a (mostly) arbitrary user via --user on docker run.
The main caveat to note is that postgres doesn't care what UID it runs as (as long as the owner of /var/lib/postgresql/data matches), but initdb does care (and needs the user to exist in /etc/passwd)
Not sure how I missed this before, but https://cwrap.org/nss_wrapper.html is the first sane solution I've seen proposed to this OpenShift-specific problem -- essentially faking software that cares to think the user we're running as exists in /etc/passwd is pretty smart IMO.
I'm reopening so we can explore this solution more.
If, like me, you wound up here because your Postgres container would not run on OpenShift: don't use the -alpine variant, as it still does not contain the nss-wrapper tool that is needed.
Reacted by Mikk Tendermann, Matthias Beyer, Branimir Espinoza, Gerard Otero, Ben van B, Mayur Deshmukh and Fredrik Blomqvist
Activity
yosifkit commentedon Oct 18, 2017
Yes, this is noted in the documentation.
mkjpryor-stfc commentedon Apr 3, 2018
@yosifkit: Just because it is noted in the documentation doesn't mean that it is OK.
This is a major pain when running on OpenShift, and could be fixed by a simple use of nss_wrapper.
tianon commentedon May 24, 2018
Not sure how I missed this before, but https://cwrap.org/nss_wrapper.html is the first sane solution I've seen proposed to this OpenShift-specific problem -- essentially faking software that cares to think the user we're running as exists in
/etc/passwdis pretty smart IMO.I'm reopening so we can explore this solution more.
tianon commentedon May 24, 2018
https://bugs.alpinelinux.org/issues/6710 makes me sad, but https://packages.debian.org/source/stretch/nss-wrapper is a good sign! (so at least Debian-based images using this would be pretty trivial)
tianon commentedon May 24, 2018
Success! #448
rgov commentedon Jun 1, 2019
If, like me, you wound up here because your Postgres container would not run on OpenShift: don't use the
-alpinevariant, as it still does not contain thenss-wrappertool that is needed.