Tag: postgresql

Is Postgres designed to write to shared data stores?

Here’s an important tip about volume sharing in docker: Multiple containers can also share one or more data volumes. However, multiple containers writing to a single shared volume can cause data corruption. Make sure your applications are designed to write to shared data stores. In this context, does Postgres designed to write to shared data […]

Postgres docker-image won't run and won't start [closed]

I run docker-compose up I get: $ docker-compose up Starting asynchttpproxy_db_1 Starting asynchttpproxy_web_1 Attaching to asynchttpproxy_db_1, asynchttpproxy_web_1 db_1 | LOG: database system was shut down at 2017-05-01 05:11:54 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: database system is ready to accept connections web_1 | Performing system checks… web_1 […]

How to alter the mount point of PostgreSQL through Docker?

I want to spin-up a docker for postgres:latest but let the data be stored on the host. This is how I do it right now but doesn’t seem to work. Any ideas? docker run –name name1 -e POSTGRES_PASSWORD=PASSWORD1 -e POSTGRES_USER=USER1 -e PGDATA=/my/local/path/postgresql -e POSTGRES_DB=DB1 -d -P postgres:latest

How to create postgres extension inside the container?

I have to install hstore to my docker postgres Here is my ordinary command in the shell to execute my need psql -d template1 -c ‘create extension hstore’; If I remove that line my container, it works, but I have execute hstore installation by myself and I have to tell everyone in my project to […]

Connecting to postgres from a docker container

I’m a little lost as to why my java application can’t connect to my postgres database. I’m aiming to connect to a postgres database through jdbc. The application is to run inside a docker container. this.connection = `DriverManager.getConnection(“jdbc:postgresql://<myip>:5432/databasename”, “usr”, “password”);` I’m getting the exception: Connection refused. Check that the hostname and port are correct and […]

Dockerfile doesn't run the CMD if the ENTRYPOINT isn't finished

I am trying to run a Dockerfile that run PostgreSQL and then add some tables to it. This is my Dockerfile: FROM postgres:9.6 MAINTAINER agomez@ikerlan.es USER postgres ADD ./backup.sql /backup.sql ADD ./deploy/import_database.sh /import_database.sh USER root RUN chmod +x /import_database.sh USER postgres ENTRYPOINT ./docker-entrypoint.sh postgres CMD ./import_database.sh The entrypoint doesn’t finish becouse it runs the postgres […]

docker-compose postgres customize database details

I am trying to dockerize my existing django application using docker and docker-compose. Insead of using the default postgres db, I want to create a db with a new name, user id and password. Here is the config that I am using. When I attach to the db container, I still see only the default […]

How to add more feature to a official postgres image from docker hub?

If use the official postgres image: https://hub.docker.com/_/postgres/ is a simple way to use PostgreSQL database. But if I need to use some PostgreSQL extention such as pgroonga: https://pgroonga.github.io How to add this to that official PostgreSQL image? Run that image as a container, then sign in to it add extention, finally make a new image? […]

Why does my postgres data disappear after loading it from a backup?

I’m using the official Postgres docker image and I’ve added a shell script that should load the backup before starting the server for real (following the instructions under ‘How to extend this image’ on this page My load backup script is as follows: gosu postgres pg_ctl start -w -D /var/lib/postgresql/data gosu postgres psql -d postgres […]

Cannot get postgresql-9.3-postgis-2.1 on Ubuntu 14.04.1 Docker container

I tried to install postgresql-9.3-postgis-2.1 or postgresql-9.1-postgis-2.1 for a cloned app, but I can only get postgresql-9.4-postgis-2.1 on my Ubuntu docker image which is build from python:2.7 image. I looked into the image and found it’s on a Ubuntu 14.04.1 image. I tries to install postgis on my Xubuntu 14.04.2 VM, everything is OK. How […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.