Skip to content

No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning). #178

@gayanath

Description

@gayanath

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions