Allow arbitrary --user values (mostly) by tianon · Pull Request #253 · docker-library/postgres · GitHub
Skip to content

Allow arbitrary --user values (mostly)#253

Merged
yosifkit merged 1 commit into
docker-library:masterfrom
infosiftr:any-user
Jan 19, 2017
Merged

Allow arbitrary --user values (mostly)#253
yosifkit merged 1 commit into
docker-library:masterfrom
infosiftr:any-user

Conversation

@tianon

@tianon tianon commented Jan 19, 2017

Copy link
Copy Markdown
Member

One special case is that initdb requires the current user to exist in /etc/passwd, but running PostgreSQL itself does not require that.

As discussed over in #93 (comment).

See also docker-library/rabbitmq#60, docker-library/cassandra#48, docker-library/mongo#81, redis/docker-library-redis#48, docker-library/mysql#161, MariaDB/mariadb-docker#59, docker-library/percona#21, and TryGhost/docker-library-ghost#54.

Closes #46
Closes #116
Closes #206
Closes #251
Ref #28

One special case is that `initdb` _requires_ the current user to exist in `/etc/passwd`, but running PostgreSQL itself does not require that.
@tianon

tianon commented Jan 19, 2017

Copy link
Copy Markdown
Member Author

@tianon

tianon commented Jan 19, 2017

Copy link
Copy Markdown
Member Author

The following comment from docker-library/mysql#161 (comment) also applies here:

I think the main difference is that the initdb.d scripts will no longer be run as root; not sure if that will break too many users.

@yosifkit

Copy link
Copy Markdown
Member

With regards to my comment of it breaking people that are taking advantage of being root while in initdb.d scripts, I would point out that the change was pushed to mysql on May 17, 2016 and to mariadb and percona on May 18. 2016 and there has yet to be an issue reported about it.

@yosifkit yosifkit merged commit 00706ec into docker-library:master Jan 19, 2017
@yosifkit yosifkit deleted the any-user branch January 19, 2017 23:39
@yosifkit

Copy link
Copy Markdown
Member

We'll probably want to add some docs about the limitations observed here.

@tianon

tianon commented Jan 20, 2017

Copy link
Copy Markdown
Member Author

docker-library/docs#802 👍

tianon added a commit to infosiftr/stackbrew that referenced this pull request Jan 20, 2017
- `bash`: 4.4.7
- `golang`: 1.8rc2
- `haproxy`: add Lua support (docker-library/haproxy#38)
- `postgres`: (mostly) arbitrary `--user` support (docker-library/postgres#253)
- `python`: 3.4.6
mcanevet added a commit to camptocamp/docker-postgres-cluster-conf that referenced this pull request Jan 25, 2017
@srstsavage

Copy link
Copy Markdown

FWIW this did cause an issue for us, as a .pgpass file provided in a volume mounted to /root/.pgpass suddenly stopped working. It took a while to figure out why with inconsistent behavior between various postgres:9.6 images cached on different workstations/servers. Easy fix once we figured out what was going on, but it wasn't immediately obvious.

The How to extend this image section in the docs stll doesn't explicitly say that *.sh scripts will be run by the postgres user by default, that might help.

@tianon

tianon commented Feb 28, 2017

Copy link
Copy Markdown
Member Author

Excellent idea, thanks @shane-axiom ❤️

I've filed a PR at docker-library/docs#848 👍

lag-linaro pushed a commit to lag-linaro/fluentd-docker-image that referenced this pull request Nov 16, 2018
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: redis/docker-library-redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: TryGhost/docker-library-ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
lag-linaro pushed a commit to lag-linaro/fluentd-docker-image that referenced this pull request Nov 19, 2018
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: redis/docker-library-redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: TryGhost/docker-library-ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
lag-linaro pushed a commit to lag-linaro/fluentd-docker-image that referenced this pull request Nov 23, 2018
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: redis/docker-library-redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: TryGhost/docker-library-ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
lag-linaro pushed a commit to lag-linaro/fluentd-docker-image that referenced this pull request Nov 30, 2018
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: redis/docker-library-redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: TryGhost/docker-library-ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
lag-linaro pushed a commit to lag-linaro/fluentd-docker-image that referenced this pull request Dec 19, 2018
If permissions problems exist, they should be overcome properly.

For examples see:

  LINK: docker-library/rabbitmq#60
  LINK: docker-library/cassandra#48
  LINK: docker-library/mongo#81
  LINK: redis/docker-library-redis#48
  LINK: docker-library/mysql#161
  LINK: MariaDB/mariadb-docker#59
  LINK: docker-library/percona#21
  LINK: TryGhost/docker-library-ghost#54
  LINK: docker-library/postgres#253

As suggested by @tianon

  LINK: docker-library/official-images#3724 (comment)

This is part of an effort to make FluentD part of Docker's Official Images.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
@willemavjc

This comment has been minimized.

@tianon

tianon commented Mar 25, 2019

Copy link
Copy Markdown
Member Author

This PR isn't (and really can't) be the cause of PostgreSQL not working on Windows -- it doesn't change anything about how postgres itself runs. The bit you quoted refers to how /docker-entrypoint-initdb.d scripts are run -- previously those ran as root, now they run as the same user PostgreSQL does (which makes way more sense anyhow).

If you want to bypass our behavior entirely, it should be trivial to do so via --entrypoint postgres (which would be the only way to start the postgres daemon itself as root with the current image script, although I'm not sure whether PostgreSQL itself will allow that or whether it balks at running as root).

@willemavjc

This comment has been minimized.

@yosifkit

Copy link
Copy Markdown
Member

@willemavjc, try this comment: #558 (comment).

tldr: it is not possible on Docker for Windows for Postgres to use a shared folder to the host

@willemavjc

Copy link
Copy Markdown

@docker-library docker-library locked as off-topic and limited conversation to collaborators Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants