From db0d6f9b75f379f8c815511635fb3a16f14b7ceb Mon Sep 17 00:00:00 2001 From: Pavel Bychko Date: Sat, 4 Mar 2023 15:53:37 +0300 Subject: [PATCH] Add POSTGRES_CLIENT_VERSION option --- .env.example | 1 + docker-compose.yml | 2 ++ php-fpm/Dockerfile | 3 ++- workspace/Dockerfile | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 550825f..4b05187 100644 --- a/.env.example +++ b/.env.example @@ -460,6 +460,7 @@ MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d ### POSTGRES ############################################## POSTGRES_VERSION=alpine +POSTGRES_CLIENT_VERSION=15 POSTGRES_DB=default POSTGRES_USER=default POSTGRES_PASSWORD=secret diff --git a/docker-compose.yml b/docker-compose.yml index 174dd25..23faf29 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -130,6 +130,7 @@ services: - INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM} - INSTALL_DUSK_DEPS=${WORKSPACE_INSTALL_DUSK_DEPS} - INSTALL_PG_CLIENT=${WORKSPACE_INSTALL_PG_CLIENT} + - PG_CLIENT_VERSION=${POSTGRES_CLIENT_VERSION} - INSTALL_PHALCON=${WORKSPACE_INSTALL_PHALCON} - INSTALL_SWOOLE=${WORKSPACE_INSTALL_SWOOLE} - INSTALL_TAINT=${WORKSPACE_INSTALL_TAINT} @@ -246,6 +247,7 @@ services: - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} - INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL} - INSTALL_PG_CLIENT=${PHP_FPM_INSTALL_PG_CLIENT} + - PG_CLIENT_VERSION=${POSTGRES_CLIENT_VERSION} - INSTALL_POSTGIS=${PHP_FPM_INSTALL_POSTGIS} - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} - INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT} diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 3feda18..bcf53b1 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -193,6 +193,7 @@ RUN if [ ${INSTALL_PGSQL} = true ]; then \ ARG INSTALL_PG_CLIENT=false ARG INSTALL_POSTGIS=false +ARG PG_CLIENT_VERSION RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ apt-get install -yqq gnupg \ @@ -200,7 +201,7 @@ RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ && echo "deb http://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main" > /etc/apt/sources.list.d/pgdg.list \ && curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update -yqq \ - && apt-get install -yqq postgresql-client-12 postgis; \ + && apt-get install -yqq postgresql-client-${PG_CLIENT_VERSION} postgis; \ if [ ${INSTALL_POSTGIS} = true ]; then \ apt-get install -yqq postgis; \ fi \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index e4e0aa0..8b9f9a1 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1284,6 +1284,7 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ USER root ARG INSTALL_PG_CLIENT=false +ARG PG_CLIENT_VERSION RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ # Install the pgsql client @@ -1291,7 +1292,7 @@ RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \ && apt-get update \ - && apt-get -y install postgresql-client-12 \ + && apt-get -y install postgresql-client-${PG_CLIENT_VERSION} \ ;fi ###########################################################################