diff --git a/infra/docker/database/pg13_16.Dockerfile b/infra/docker/database/pg13_16.Dockerfile index 57d5b278e4..bb531180ec 100644 --- a/infra/docker/database/pg13_16.Dockerfile +++ b/infra/docker/database/pg13_16.Dockerfile @@ -2,7 +2,7 @@ ARG PG_MAJOR ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION -FROM postgres:$PG_MAJOR-bookworm +FROM postgres:"$PG_MAJOR"-bookworm ARG PG_MAJOR ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION @@ -11,7 +11,8 @@ RUN \ apt-get update && \ apt-get install -y \ wget \ - lsb-release + lsb-release && \ + rm -rf /var/lib/apt/lists/* # Install TimescaleDB extension RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" @@ -19,25 +20,25 @@ RUN echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_releas RUN wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | apt-key add - RUN \ - TIMESCALEDB_MAJOR=$(echo $TIMESCALEDB_VERSION | cut -c1) && \ + TIMESCALEDB_MAJOR=$(echo "$TIMESCALEDB_VERSION" | cut -c1) && \ apt-get update && \ apt-get install -y \ - timescaledb-$TIMESCALEDB_MAJOR-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* \ - timescaledb-$TIMESCALEDB_MAJOR-loader-postgresql-$PG_MAJOR=$TIMESCALEDB_VERSION* && \ + timescaledb-"$TIMESCALEDB_MAJOR"-postgresql-"$PG_MAJOR"="$TIMESCALEDB_VERSION"* \ + timescaledb-"$TIMESCALEDB_MAJOR"-loader-postgresql-"$PG_MAJOR"="$TIMESCALEDB_VERSION"* && \ rm -rf /var/lib/apt/lists/* RUN for file in $(find /usr/share/postgresql -name 'postgresql.conf.sample'); do \ # We want timescaledb to be loaded in this image by every created cluster - sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" $file \ + sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" "$file" \ # We need to listen on all interfaces, otherwise PostgreSQL is not accessible - && echo "listen_addresses = '*'" >> $file; \ + && echo "listen_addresses = '*'" >> "$file"; \ done # Install PostGIS extension RUN \ - POSTGIS_MAJOR=$(echo $POSTGIS_VERSION | cut -c1) && \ + POSTGIS_MAJOR=$(echo "$POSTGIS_VERSION" | cut -c1) && \ apt update && \ apt install -y --no-install-recommends \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION* \ - postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts && \ + postgresql-"$PG_MAJOR"-postgis-"$POSTGIS_MAJOR"="$POSTGIS_VERSION"* \ + postgresql-"$PG_MAJOR"-postgis-"$POSTGIS_MAJOR"-scripts && \ rm -rf /var/lib/apt/lists/* \ No newline at end of file