diff options
author | 2021-12-11 18:06:44 +0000 | |
---|---|---|
committer | 2021-12-11 18:06:44 +0000 | |
commit | 3611ce9d2dfb5348c4dcd8480414a96f1447d05b (patch) | |
tree | 309b5fbed9a650eac173789ecfef01aecbd13614 | |
parent | Add a README file (diff) |
Build and install pg_cron from source
-rw-r--r-- | Dockerfile | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -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"] |