Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build postgres:11+periods Docker image #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/