mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-06-28 01:14:58 +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
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends postgresql postgresql-client && \
|
||||
rm -rf /var/lib/postgresql && \
|
||||
rm -rf /var/lib/apt/lists/* # 20140818
|
||||
apt-get install -y --no-install-recommends postgresql postgresql-client && \
|
||||
rm -rf /var/lib/postgresql && \
|
||||
rm -rf /var/lib/apt/lists/* # 20140818
|
||||
|
||||
ADD start /start
|
||||
RUN chmod 755 /start
|
||||
|
||||
@@ -20,26 +20,26 @@ EOF
|
||||
|
||||
# initialize PostgreSQL data directory
|
||||
if [ ! -d /var/lib/postgresql/9.1/main ]; then
|
||||
echo "Initializing database..."
|
||||
PG_PASSWORD=$(pwgen -c -n -1 14)
|
||||
echo "${PG_PASSWORD}" > /var/lib/postgresql/pwfile
|
||||
sudo -u postgres -H /usr/lib/postgresql/9.1/bin/initdb \
|
||||
--pgdata=/var/lib/postgresql/9.1/main --pwfile=/var/lib/postgresql/pwfile \
|
||||
--username=postgres --encoding=unicode --auth=trust >/dev/null
|
||||
echo "Initializing database..."
|
||||
PG_PASSWORD=$(pwgen -c -n -1 14)
|
||||
echo "${PG_PASSWORD}" > /var/lib/postgresql/pwfile
|
||||
sudo -u postgres -H /usr/lib/postgresql/9.1/bin/initdb \
|
||||
--pgdata=/var/lib/postgresql/9.1/main --pwfile=/var/lib/postgresql/pwfile \
|
||||
--username=postgres --encoding=unicode --auth=trust >/dev/null
|
||||
fi
|
||||
|
||||
if [ -f /var/lib/postgresql/pwfile ]; then
|
||||
PG_PASSWORD=$(cat /var/lib/postgresql/pwfile)
|
||||
echo "|------------------------------------------------------------------|"
|
||||
echo "| PostgreSQL User: postgres, Password: ${PG_PASSWORD} |"
|
||||
echo "| |"
|
||||
echo "| To remove the PostgreSQL login credentials from the logs, please |"
|
||||
echo "| make a note of password and then delete the file pwfile |"
|
||||
echo "| from the data store. |"
|
||||
echo "|------------------------------------------------------------------|"
|
||||
PG_PASSWORD=$(cat /var/lib/postgresql/pwfile)
|
||||
echo "|------------------------------------------------------------------|"
|
||||
echo "| PostgreSQL User: postgres, Password: ${PG_PASSWORD} |"
|
||||
echo "| |"
|
||||
echo "| To remove the PostgreSQL login credentials from the logs, please |"
|
||||
echo "| make a note of password and then delete the file pwfile |"
|
||||
echo "| from the data store. |"
|
||||
echo "|------------------------------------------------------------------|"
|
||||
fi
|
||||
|
||||
echo "Starting PostgreSQL server..."
|
||||
exec sudo -u postgres -H /usr/lib/postgresql/9.1/bin/postgres \
|
||||
-D /var/lib/postgresql/9.1/main \
|
||||
-c config_file=/etc/postgresql/9.1/main/postgresql.conf
|
||||
-D /var/lib/postgresql/9.1/main \
|
||||
-c config_file=/etc/postgresql/9.1/main/postgresql.conf
|
||||
|
||||
Reference in New Issue
Block a user