mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-09-09 11:21:30 +08:00
use spaces to indent
This commit is contained in:
+3
-3
@@ -2,9 +2,9 @@ FROM sameersbn/ubuntu:12.04.20140818
|
|||||||
MAINTAINER sameer@damagehead.com
|
MAINTAINER sameer@damagehead.com
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends postgresql postgresql-client && \
|
apt-get install -y --no-install-recommends postgresql postgresql-client && \
|
||||||
rm -rf /var/lib/postgresql && \
|
rm -rf /var/lib/postgresql && \
|
||||||
rm -rf /var/lib/apt/lists/* # 20140818
|
rm -rf /var/lib/apt/lists/* # 20140818
|
||||||
|
|
||||||
ADD start /start
|
ADD start /start
|
||||||
RUN chmod 755 /start
|
RUN chmod 755 /start
|
||||||
|
|||||||
@@ -20,26 +20,26 @@ EOF
|
|||||||
|
|
||||||
# initialize PostgreSQL data directory
|
# initialize PostgreSQL data directory
|
||||||
if [ ! -d /var/lib/postgresql/9.1/main ]; then
|
if [ ! -d /var/lib/postgresql/9.1/main ]; then
|
||||||
echo "Initializing database..."
|
echo "Initializing database..."
|
||||||
PG_PASSWORD=$(pwgen -c -n -1 14)
|
PG_PASSWORD=$(pwgen -c -n -1 14)
|
||||||
echo "${PG_PASSWORD}" > /var/lib/postgresql/pwfile
|
echo "${PG_PASSWORD}" > /var/lib/postgresql/pwfile
|
||||||
sudo -u postgres -H /usr/lib/postgresql/9.1/bin/initdb \
|
sudo -u postgres -H /usr/lib/postgresql/9.1/bin/initdb \
|
||||||
--pgdata=/var/lib/postgresql/9.1/main --pwfile=/var/lib/postgresql/pwfile \
|
--pgdata=/var/lib/postgresql/9.1/main --pwfile=/var/lib/postgresql/pwfile \
|
||||||
--username=postgres --encoding=unicode --auth=trust >/dev/null
|
--username=postgres --encoding=unicode --auth=trust >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /var/lib/postgresql/pwfile ]; then
|
if [ -f /var/lib/postgresql/pwfile ]; then
|
||||||
PG_PASSWORD=$(cat /var/lib/postgresql/pwfile)
|
PG_PASSWORD=$(cat /var/lib/postgresql/pwfile)
|
||||||
echo "|------------------------------------------------------------------|"
|
echo "|------------------------------------------------------------------|"
|
||||||
echo "| PostgreSQL User: postgres, Password: ${PG_PASSWORD} |"
|
echo "| PostgreSQL User: postgres, Password: ${PG_PASSWORD} |"
|
||||||
echo "| |"
|
echo "| |"
|
||||||
echo "| To remove the PostgreSQL login credentials from the logs, please |"
|
echo "| To remove the PostgreSQL login credentials from the logs, please |"
|
||||||
echo "| make a note of password and then delete the file pwfile |"
|
echo "| make a note of password and then delete the file pwfile |"
|
||||||
echo "| from the data store. |"
|
echo "| from the data store. |"
|
||||||
echo "|------------------------------------------------------------------|"
|
echo "|------------------------------------------------------------------|"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting PostgreSQL server..."
|
echo "Starting PostgreSQL server..."
|
||||||
exec sudo -u postgres -H /usr/lib/postgresql/9.1/bin/postgres \
|
exec sudo -u postgres -H /usr/lib/postgresql/9.1/bin/postgres \
|
||||||
-D /var/lib/postgresql/9.1/main \
|
-D /var/lib/postgresql/9.1/main \
|
||||||
-c config_file=/etc/postgresql/9.1/main/postgresql.conf
|
-c config_file=/etc/postgresql/9.1/main/postgresql.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user