Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (53 loc) · 2.28 KB
/
Copy pathDockerfile
File metadata and controls
66 lines (53 loc) · 2.28 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM ubuntu:latest
ARG POSTGRES_VERSION
ARG GRAPHBLAS_VERSION
ARG LAGRAPH_VERSION
# install base dependences
RUN apt-get update && \
apt-get install -y make cmake git curl build-essential m4 sudo gdbserver python3-pip \
gdb libreadline-dev bison flex zlib1g-dev libicu-dev icu-devtools tmux zile zip vim \
gawk wget python3-full python3-virtualenv graphviz
RUN deluser --remove-home ubuntu
# add postgres user and make data dir
RUN groupadd -r postgres && useradd --no-log-init -r -m -s /bin/bash -g postgres -G sudo postgres
# make postgres a sudoer
RUN echo "postgres ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user
USER postgres
ENV PGDATA /home/postgres/data
RUN /bin/rm -Rf "$PGDATA" && mkdir "$PGDATA"
WORKDIR "/home/postgres"
# get PostgreSQL source and compile with debug and no optimization
RUN curl -fsSLO https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgresql-${POSTGRES_VERSION}.tar.bz2 && \
tar -xjf postgresql-${POSTGRES_VERSION}.tar.bz2 && \
cd postgresql-${POSTGRES_VERSION} && ./configure \
--prefix=/usr/ \
--without-icu \
--enable-debug \
--enable-depend --enable-cassert --enable-profiling \
# CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" \
# CFLAGS="-O3" \
&& make -j 4 && sudo make install
# get GraphBLAS, compile with debug symbols
RUN curl -s -L -J https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${GRAPHBLAS_VERSION}.tar.gz | \
tar zxvf - && cd GraphBLAS-${GRAPHBLAS_VERSION} && \
make library \
CMAKE_OPTIONS='-DGRAPHBLAS_COMPACT=1' \
&& sudo make install \
&& /bin/rm -Rf GraphBLAS-${GRAPHBLAS_VERSION}
RUN curl -s -L -J https://github.com/GraphBLAS/LAGraph/archive/refs/tags/v${LAGRAPH_VERSION}.tar.gz | \
tar zxvf - && cd LAGraph-${LAGRAPH_VERSION} && \
make library \
&& sudo make install \
&& /bin/rm -Rf LAGraph-${LAGRAPH_VERSION}
RUN sudo ldconfig
# put test stuff into pg home
RUN mkdir "/home/postgres/onesparse"
WORKDIR "/home/postgres/onesparse"
COPY . .
RUN sudo make && sudo make install && sudo make clean
# start the database
RUN initdb -D "$PGDATA" -c shared_preload_libraries='onesparse' -c search_path='onesparse' --encoding UTF8
EXPOSE 5432
# wait forever
CMD tail -f /dev/null