aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-12-11 18:06:44 +0000
committerGravatar Chris Lovering <[email protected]>2021-12-11 18:06:44 +0000
commit3611ce9d2dfb5348c4dcd8480414a96f1447d05b (patch)
tree309b5fbed9a650eac173789ecfef01aecbd13614
parentAdd a README file (diff)
Build and install pg_cron from source
-rw-r--r--Dockerfile21
1 files changed, 18 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index 41da4ee..1622047 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,27 @@
FROM postgres:14-alpine
-RUN apk add postgresql-pg_cron --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
+ENV PG_CRON_VERSION 1.4.1
-COPY docker-entrypoint.sh /usr/local/bin/
+# Download, build & install pg_cron
+RUN apk add --no-cache --virtual .build-deps \
+ cmake build-base wget postgresql-dev && \
+ mkdir /build && \
+ cd /build && \
+ wget https://github.com/citusdata/pg_cron/archive/v$PG_CRON_VERSION.tar.gz && \
+ tar xzvf v$PG_CRON_VERSION.tar.gz && \
+ cd pg_cron-$PG_CRON_VERSION && \
+ make && \
+ make install && \
+# Clean up:
+ cd / && \
+ rm -rf /build && \
+ apk del .build-deps
+
+COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod a+x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 5432
-CMD ["postgres"] \ No newline at end of file
+CMD ["postgres"]