-
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
No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning). #178
Comments
You definitely shouldn't be running the $ docker run --name postgres-1 -e POSTGRES_PASSWORD=postgres -d postgres:9.5.3992fd0e32d3e673f2c88c43a72b4ad43e5369d7974ae9d10dec789b6d4f45029
$ docker run -it --rm postgres psql -U postgres -h ip-of-postgres-container
Password for user postgres:
psql (9.5.3)
Type "help" for help.
postgres=# As for changing the locale, that is in the docs under how-to-extend-this-image. This is the source for the docs on the Docker Hub. |
@yosifkit Thanks a lot for the explanation. For some reason, the first few times I tried the container, I couldn't connect to it from localhost even with port mapping. That's why I tried getting it working as above. Now I can connect from localhost with a command like below.
|
Just in case it is useful for somebody, in my case I got that error because I was running the container with another process within it (because of a helper shell function that I didn't realize it was not right in this case). So, I was running something like: docker run --name postgres-1 -e POSTGRES_PASSWORD=postgres -d postgres:9.5.3 tail -f /dev/null |
I am using Docker for Mac (Version 1.12.0-rc4-beta20 (build: 10404))
After creating a container, I couldn't connect to Postgres. Following is what I did to reproduce the issue, and get it working.
docker run --name postgres-1 -e POSTGRES_PASSWORD=postgres -d postgres:9.5.3
docker exec -it postgres-1 /bin/bash
root@ee38e70bca23:/# /etc/init.d/postgresql start
Above
/etc/init.d/postgresql start
command gave the following error.No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).
After googling I found http://dba.stackexchange.com/questions/50906/why-wont-postgresql-9-3-start-on-ubuntu
Ran following commands, and after that Postgres was running.
root@ee38e70bca23:/# dpkg-reconfigure locales
root@ee38e70bca23:/# pg_createcluster 9.5 main --start
root@ee38e70bca23:/# /etc/init.d/postgresql start
Running
dpkg-reconfigure locales
prompted me to choose a locale, and I chose en_US.utf8. How can I extend this image, and use RUN commands in a Dockerfile to avoid prompting to choose the locale?Is this something that can be fixed in
postgres
image?The text was updated successfully, but these errors were encountered: