forked from tripsolutions/postgres-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (20 loc) · 664 Bytes
/
Dockerfile
File metadata and controls
23 lines (20 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# add extensions to cnpg postgresql image: timescaledb, pg_cron
ARG POSTGRESQL_VERSION=15.3
ARG EXTENSIONS="timescaledb cron"
ARG TIMESCALEDB_VERSION=2.11.0
FROM ghcr.io/cloudnative-pg/postgresql:${POSTGRESQL_VERSION}
ARG EXTENSIONS
ENV EXTENSIONS=${EXTENSIONS}
ARG TIMESCALEDB_VERSION
ENV TIMESCALEDB_VERSION=${TIMESCALEDB_VERSION}
COPY ./install_pg_extensions.sh /
# switch to root user to install extensions
USER root
RUN \
apt-get update && \
/install_pg_extensions.sh ${EXTENSIONS} && \
# cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /install_pg_extensions.sh
# switch back to the postgres user
USER postgres