Skip to content

Implement "nss_wrapper" for Debian variants - #448

Merged
yosifkit merged 1 commit into
docker-library:masterfrom
infosiftr:nss_wrapper
May 24, 2018
Merged

Implement "nss_wrapper" for Debian variants#448
yosifkit merged 1 commit into
docker-library:masterfrom
infosiftr:nss_wrapper

Conversation

@tianon

Copy link
Copy Markdown
Member

Closes#359

$ docker build 10...Successfully built 8808cf28be91
$ mkdir "$HOME/pgtemp"
$ sudo chown 1000:1000 "$HOME/pgtemp"
$ docker run -it --rm --user 1000:1000 -v "$HOME/pgtemp":/var/lib/postgresql/data 8808cf28be91The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.utf8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /var/lib/postgresql/data ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... oksyncing data to disk ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success. You can now start the database server using: pg_ctl -D /var/lib/postgresql/data -l logfile start****************************************************WARNING: No password has been set for the database. This will allow anyone with access to the Postgres port to access your database. In Docker's default configuration, this is effectively any other container on the same system. Use "-e POSTGRES_PASSWORD=password" to set it in "docker run".****************************************************waiting for server to start....2018-05-24 18:47:31.537 UTC [37] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"2018-05-24 18:47:31.560 UTC [38] LOG: database system was shut down at 2018-05-24 18:47:31 UTC2018-05-24 18:47:31.565 UTC [37] LOG: database system is ready to accept connections doneserver startedALTER ROLE/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*2018-05-24 18:47:31.655 UTC [37] LOG: received fast shutdown requestwaiting for server to shut down....2018-05-24 18:47:31.656 UTC [37] LOG: aborting any active transactions2018-05-24 18:47:31.657 UTC [37] LOG: worker process: logical replication launcher (PID 44) exited with exit code 12018-05-24 18:47:31.657 UTC [39] LOG: shutting down2018-05-24 18:47:31.671 UTC [37] LOG: database system is shut down doneserver stoppedPostgreSQL init process complete; ready for start up.2018-05-24 18:47:31.781 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 54322018-05-24 18:47:31.781 UTC [1] LOG: listening on IPv6 address "::", port 54322018-05-24 18:47:31.785 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"2018-05-24 18:47:31.810 UTC [55] LOG: database system was shut down at 2018-05-24 18:47:31 UTC2018-05-24 18:47:31.815 UTC [1] LOG: database system is ready to accept connections

@tianon

Copy link
Copy Markdown
MemberAuthor

So, as long as OpenShift takes care of making sure the user it gives us has permission to the volume it provides, this should be sufficient.

@tianon

Copy link
Copy Markdown
MemberAuthor

Documentation updated in docker-library/docs#1239

tianon added a commit to infosiftr/stackbrew that referenced this pull request May 25, 2018
- `mariadb`: 10.3.7
- `memcached`: 1.5.8
- `php`: 7.2.6
- `postgres`: implement `nss_wrapper` for Debian variants (docker-library/postgres#448)
- `redmine`: fix build (docker-library/redmine#116)
- `wordpress`: add `zip` extension for "Export Personal Data" (docker-library/wordpress#304)
@luckydonald

Copy link
Copy Markdown

But how do I use it now?

@yosifkit

Copy link
Copy Markdown
Member

But how do I use it now?

Just add --user on the docker run for the desired user ID and provide a volume/directory that the said user can write to (and owns):

$ mkdir "$HOME/pgtemp"
$ sudo chown 1000:1000 "$HOME/pgtemp"
$ docker run -it --rm --user 1000:1000 -v "$HOME/pgtemp":/var/lib/postgresql/data -e POSTGRES_PASSWORD=mysecretpassword postgres

@ConYel

This comment was marked as off-topic.

@sanyer

This comment was marked as off-topic.

@ConYel

This comment was marked as off-topic.

@tianon

This comment was marked as off-topic.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run on openshift 3.6, user does not exist

5 participants

@tianon@luckydonald@yosifkit@ConYel@sanyer