Commit 771bd70a339053a8fefb083e7feba56ae5258c42

Authored by Igor Kulikov
1 parent 57c2915e

Fix tb-postgres docker image. Update postgreSQL version to 11

... ... @@ -17,7 +17,11 @@
17 17 FROM thingsboard/openjdk8
18 18
19 19 RUN apt-get update
20   -RUN apt-get install -y postgresql postgresql-contrib
  20 +RUN apt-get install -y curl
  21 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' | tee --append /etc/apt/sources.list.d/pgdg.list > /dev/null
  22 +RUN curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
  23 +RUN apt-get update
  24 +RUN apt-get install -y postgresql-11
21 25 RUN update-rc.d postgresql disable
22 26
23 27 RUN mkdir -p /var/log/postgres
... ...
... ... @@ -17,13 +17,15 @@
17 17
18 18 firstlaunch=${DATA_FOLDER}/.firstlaunch
19 19
  20 +export PG_CTL=$(find /usr/lib/postgresql/ -name pg_ctl)
  21 +
20 22 if [ ! -d ${PGDATA} ]; then
21 23 mkdir -p ${PGDATA}
22 24 chown -R postgres:postgres ${PGDATA}
23   - su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl initdb -U postgres'
  25 + su postgres -c '${PG_CTL} initdb -U postgres'
24 26 fi
25 27
26   -su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl -l /var/log/postgres/postgres.log -w start'
  28 +su postgres -c '${PG_CTL} -l /var/log/postgres/postgres.log -w start'
27 29
28 30 if [ ! -f ${firstlaunch} ]; then
29 31 su postgres -c 'psql -U postgres -d postgres -c "CREATE DATABASE thingsboard"'
... ...
... ... @@ -15,4 +15,6 @@
15 15 # limitations under the License.
16 16 #
17 17
18   -su postgres -c '/usr/lib/postgresql/10/bin/pg_ctl stop'
  18 +export PG_CTL=$(find /usr/lib/postgresql/ -name pg_ctl)
  19 +
  20 +su postgres -c '${PG_CTL} stop'
... ...