-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (31 loc) · 1.08 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
# Define a build argument for the PostgreSQL version
ARG POSTGRES_VERSION
# Use the specified PostgreSQL version as the base image
FROM postgres:${POSTGRES_VERSION}
# Install the required dependencies for the HLL extension
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
postgresql-server-dev-${POSTGRES_VERSION%%.*} \
git \
ca-certificates \
wget
# Clone the HLL extension repository
RUN git clone https://github.com/citusdata/postgresql-hll.git
# Build and install the HLL extension
RUN cd postgresql-hll && \
make && \
make install
# Clean up the build dependencies
RUN apt-get remove -y \
build-essential \
postgresql-server-dev-${POSTGRES_VERSION%%.*} \
git \
ca-certificates \
wget && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /postgresql-hll
# Add the HLL extension creation command to the initialization script
RUN echo "CREATE EXTENSION hll;" > /docker-entrypoint-initdb.d/enable_hll_extension.sql