-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (35 loc) · 2.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM postgres:9.6
MAINTAINER Study Hsueh <ph.study@gmail.com>
ENV PG_MAJOR 9.6
ENV DATASKETCHES_VERSION 1.3.0
RUN echo "===> Adding prerequisites..." && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends --allow-downgrades -y -q \
ca-certificates \
build-essential wget unzip \
postgresql-server-dev-9.6 \
libpq-dev=$PG_MAJOR\* libpq5=$PG_MAJOR\* libecpg-dev && \
echo "===> Building datasketches..." && \
wget http://api.pgxn.org/dist/datasketches/$DATASKETCHES_VERSION/datasketches-$DATASKETCHES_VERSION.zip && \
unzip datasketches-$DATASKETCHES_VERSION.zip && \
wget https://github.com/apache/incubator-datasketches-postgresql/commit/fc35848a683130555bb0813afa47e4ddc6c9ba97.patch && \
patch -d datasketches-$DATASKETCHES_VERSION -p1 <fc35848a683130555bb0813afa47e4ddc6c9ba97.patch && \
wget https://github.com/apache/incubator-datasketches-cpp/commit/7b25baca55d7e0ec5949d3bb613bf37275d1ff9f.patch && \
patch -d datasketches-$DATASKETCHES_VERSION/datasketches-cpp -p1 <7b25baca55d7e0ec5949d3bb613bf37275d1ff9f.patch && \
cd datasketches-$DATASKETCHES_VERSION && \
make && \
make install && \
\
\
echo "===> Clean up..." && \
apt-get -y remove --purge --auto-remove \
ca-certificates \
build-essential wget unzip \
postgresql-server-dev-$PG_MAJOR libpq-dev libecpg-dev && \
apt-get clean && \
rm -rf datasketches-$DATASKETCHES_VERSION /var/lib/apt/lists/* /tmp/* /var/tmp/* fc35848a683130555bb0813afa47e4ddc6c9ba97.patch
ADD /docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 5432
CMD ["postgres"]