Tag: postgresql

Import osm data in Docker postgresql

i am trying to use Docker. So i installed in Docker postgresql image. Until now, when i imported osm data into postql i used this command: psql -U postgres mydb CREATE EXTENSION postgis; osm2pgsql -U postgres -d mydb -s -S ./osm_stylesheet /home/ramnikov/Downloads/hessen-latest.osm How can i do the same inside Docker after this command $ sudo […]

Node npm test to seeded postgres, Docker network container seeing varying results

I am running an Angular Node npm test against a seeded postgres database. This works in one environment but not another. I have exported the images to and moved them from one environment to the other, and the results indicate that there’s a difference with the environments and not the docker images. I also have […]

Running Tomcat with PostgreSql using Dockerfile

I want to run a Tomcat with PostgreSql database within the same Dockerfile. I have the following Dockerfile FROM tomcat:8-jre7 MAINTAINER “Sonam <mymail@gmail.com>” RUN apt-get -y update Add simplewebapp.war /usr/local/tomcat/webapps/ RUN apt-get update && apt-get -y upgrade FROM postgres When I run the docker image, I can’t access the Tomcat like I could if I […]

Customize the configuration of the official PostgreSQL docker image

I am using the official postgresql docker image (version 9.4). I have extended the Dockerfile, so I can alter the settings in the postgresql.conf etc, using a bash script. It successfully adds and runs the script on entrypoint, for a single sed command. But when I put 2 or more sed commands, I get the […]

Transition PostgreSQL persistent storage on docker to modern docker storage only

With the advent of docker volume create for storage only containers, I’m still using the old way for running postgres on my machine for small applications without a dockerfile: # MAKE MY DATA STORE STORAGE_DIR=/home/username/mydockerdata/pgdata docker create -v $STORAGE_DIR:/var/lib/postgresql/data –name mypgdata ubuntu true # CREATE THE PG docker run –name mypg -e POSTGRES_PASSWORD=password123 -d -p […]

Using the postgres image in a test

Given the following docker-compose.test.yml file: version: ‘2’ services: sut: build: . command: nosetests environment: – DJANGO_SETTINGS_MODULE=test.settings links: – db db: image: postgres expose: – 5432 Building the sut container docker-compose -f docker-compose.test.yml build sut Running the container: thomas@linuxclientlobnek01:~/github/djlobnek$ docker-compose -f docker-compose.test.yml run sut /bin/bash root@6694ec7148ac:/djlobnek# psql -h localhost -U postgres psql: could not connect to […]

How to create Postgres backups from docker container

I have a Postgres 9.5.4 database running inside a docker container. I am using the official Postgres images and I have been trying to create backups from my database, but not luck so far. According docker documentation I was expecting the following command to store the dump.tar file in the /releases/ folder in the host […]

pg_restore in postgres docker container

I am trying to restore database in PostgreSQL docker container using pg_restore from a shellscript taht will be called from docker file .I am getting following error “ERROR: canceling autovacuum task CONTEXT: automatic analyze of table ‘tablename’”. DockerFile: FROM postgres:9.3 ENV POSTGRES_USER postgres ENV POSTGRES_PASSWORD Abcd1234 ENV POSTGRES_DB Clarion1 COPY DB.backup /var/lib/postgresql/backup/DB.backup COPY initialize.sh /docker-entrypoint-initdb.d/initialize.sh […]

dockerize does not delay the container initialization

I am now preparing the images for my project. I use dockerize to control my initialization. I am not sure that hardcode the IP address given by docker is way to go or not? Problem: backend does not wait until the database finish initialization first. Terminal says backend_1 | django.db.utils.OperationalError: could not connect to server: […]

How to connect to PostgreSQL server that's run on docker

mac:camden-market dob$ docker-compose ps Name Command State Ports ————————————————————————— camdenmarket_bundle_1 sh Exit 0 camdenmarket_db_1 /docker-entrypoint.sh postgres Up 5432/tcp camdenmarket_redis_1 docker-entrypoint.sh redis … Up 6379/tcp camdenmarket_solidus_1 ./entrypoint.sh bundle exe … Exit 2 dmac:camden-market dob$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b5805a802a8a postgres “/docker-entrypoint.s” 17 hours ago Up 17 hours 5432/tcp camdenmarket_db_1 3d4d0bd45e3a […]

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