Skip to content

Commit

Permalink
Build postgres:11+periods Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
runejuhl committed Feb 27, 2020
1 parent dacb886 commit cc00e82
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 90-create-extension-periods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE EXTENSION IF NOT EXISTS periods CASCADE;
EOSQL
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM debian:10 AS build

RUN mkdir -p /opt/periods

RUN apt-get update && \
apt-get install -y --no-install-recommends devscripts

RUN apt-get install -y --no-install-recommends equivs

ADD . /opt/periods/

WORKDIR /opt/periods

RUN mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control

RUN make

RUN mkdir -p build-11 && \
mv periods.bc periods.so build-11/
RUN debuild --no-tgz-check -us -uc -b

FROM postgres:11 AS periods

COPY --from=build /opt/postgresql-11-periods_*.deb /tmp/

RUN apt-get update && \
apt-get install -y --no-install-recommends \
postgresql-11

RUN dpkg -i /tmp/*.deb

ADD 90-create-extension-periods.sh /docker-entrypoint-initdb.d/

0 comments on commit cc00e82

Please sign in to comment.