From 0f6fe5002d10af2ba1fcdf61377906591bac5225 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Wed, 13 Dec 2017 20:02:16 +0100 Subject: [PATCH] Fix postres-hstore build --- Dockerfile | 2 +- postgres-hstore/Dockerfile | 2 +- postgres-hstore/create_extension.sh | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a313bec..87fb994 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ WORKDIR /code RUN apt-get -y update RUN apt-get -y install libsasl2-dev libldap2-dev libssl-dev ADD requirements.txt /code/ -RUN pip install -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt RUN wget https://github.com/vishnubob/wait-for-it/raw/8ed92e8cab83cfed76ff012ed4a36cef74b28096/wait-for-it.sh -O /usr/local/bin/wait-for-it && chmod +x /usr/local/bin/wait-for-it ADD . /code/ diff --git a/postgres-hstore/Dockerfile b/postgres-hstore/Dockerfile index 14e4514..cb97d3d 100644 --- a/postgres-hstore/Dockerfile +++ b/postgres-hstore/Dockerfile @@ -1,3 +1,3 @@ FROM postgres:latest MAINTAINER Piotr Dobrowolski -ADD create_extension.sh docker-entrypoint-initdb.d/create_extension.sh +ADD create_extension.sh /docker-entrypoint-initdb.d/create_extension.sh diff --git a/postgres-hstore/create_extension.sh b/postgres-hstore/create_extension.sh index f28bdbe..60576f8 100644 --- a/postgres-hstore/create_extension.sh +++ b/postgres-hstore/create_extension.sh @@ -1,9 +1,12 @@ +#!/bin/bash +set -e + # Because both template1 and the user postgres database have already been created, # we need to create the hstore extension in template1 and then recreate the postgres database. # # Running CREATE EXTENSION in both template1 and postgres can lead to # the extensions having different eid's. -psql --dbname template1 <