-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build postgres:11+periods Docker image
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |