-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Docker postgres - Unable to run postgres with --version argument #636
Comments
I can reproduce in both Debian and Alpine for 12.1, it seems like it's not quite fully initialized in the latest version before it tries connecting. $ docker run --rm postgres:12.1 --version
Unable to find image 'postgres:12.1' locally
12.1: Pulling from library/postgres
8d691f585fa8: Already exists
c991029393ff: Already exists
d104c69c9175: Already exists
0a7fb105514d: Already exists
c3d11c21cb77: Already exists
4536342c5414: Already exists
435bcefd4e05: Already exists
36b0869ae6f9: Already exists
673d43b320be: Pull complete
9e1439b8c21e: Pull complete
95a87ad93bd5: Pull complete
789ac3657e75: Pull complete
c6b8132253d5: Pull complete
54f8e305bbb5: Pull complete
Digest: sha256:89a4c55b73a6aa810b23b3924368d190af6e6eb157fa8257d57f362e7eeeb9c6
Status: Downloaded newer image for postgres:12.1
****************************************************
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".
****************************************************
The 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 ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... initdb: warning: enabling "trust" authentication for local connections
You 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.
ok
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....2019-11-23 02:05:41.381 GMT [47] FATAL: --version requires a value
pg_ctl: could not start server
Examine the log output.
stopped waiting
$ docker run -d --rm --name postgres postgres:12.1-alpine
c6a70246edb89b766644a727792c000ced4e96407ad2f98cfd558648963c9a09
$ docker exec postgres psql --version
psql (PostgreSQL) 12.1 |
The cause of this was #496 and specifically this comment noted the change: #496 (comment) It looks like we may need a |
Fix #647 causes a problem. When creating multi-stage builds, the "--help" argument was very useful to allow initial data creation. Something like:
A tutorial can be found here: This is no longer possible because the important part of the script is not triggered anymore. And there is no other args which exits immediately afterwards anymore. Any hints how to avoid that? |
mdillion/postgis image was discontinued... docker-entrypoint.sh --help can no longer be used to prepopulate data docker-library/postgres#636 Use healthcheck to determine if postgres is ready
In 12.0-alpine, passing the --version argument to docker run worked. This no longer works the same way in 12.1-alpine. I think the arguments are also being passed into pg_ctl in the startup script instead of just postgres which probably won't work in both places with the same arguments.
docker run --rm postgres:12.0-alpine --version
docker run --rm postgres:12.1-alpine --version
The text was updated successfully, but these errors were encountered: