Repository navigation
Expand file tree
/
Copy pathDockerfile-debug
More file actions
102 lines (86 loc) · 3.49 KB
/
Copy pathDockerfile-debug
File metadata and controls
102 lines (86 loc) · 3.49 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM ubuntu:latest
ARG UID
ARG GID
# 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 \
gawk wget python3-full python3-virtualenv graphviz python3-dev libpq-dev \
python3-psycopg2 libssl-dev gnuplot python3-graph-tool pkg-config ca-certificates \
liblz4-dev libzstd-dev libxml2-dev libxslt1-dev
RUN deluser --remove-home ubuntu
# add postgres user and make data dir
RUN groupadd --gid ${GID} -r postgres && useradd --uid ${UID} --gid ${GID} --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"
RUN set -eux; \
curl -fsSLO https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0.tar.bz2; \
tar -xjf postgresql-18.0.tar.bz2; \
cd postgresql-18.0; \
./configure --prefix=/usr --with-openssl --with-icu --with-lz4 --with-zstd \
--enable-debug \
--enable-depend --enable-cassert --enable-profiling \
CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"; \
make -j"$(nproc)"; \
sudo make install; \
cd ..; \
sudo rm -rf postgresql-18.0 postgresql-18.0.tar.bz2 /var/lib/apt/lists/*
# # get postgres source and compile with debug and no optimization
# RUN git clone https://github.com/postgres/postgres.git --depth=1 && \
# # git checkout REL_18_BETA1 && \
# cd postgres && ./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
# COPY --chown=postgres:postgres postgres-upstream postgres-upstream
# RUN cd postgres-upstream && ./configure \
# --prefix=/usr/ \
# --with-python \
# --with-openssl \
# --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 \
# && cd contrib/postgres_fdw && make && sudo make install \
# && cd .. && /bin/rm -Rf postgres-upstream
# get GraphBLAS, compile with debug symbols
RUN curl -s -L -J https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v10.2.0.tar.gz | \
tar zxvf - && cd GraphBLAS-10.2.0 && \
make debug \
# CMAKE_OPTIONS='-DGRAPHBLAS_COMPACT=1 ' \
&& sudo make install \
&& /bin/rm -Rf GraphBLAS-10.2.0
RUN curl -s -L -J https://github.com/GraphBLAS/LAGraph/archive/refs/tags/v1.2.1.tar.gz | \
tar zxvf - && cd LAGraph-1.2.1 && \
make library \
&& sudo make install \
&& /bin/rm -Rf LAGraph-1.2.1
RUN sudo ldconfig
# put test stuff into pg home
RUN mkdir "/home/postgres/onesparse"
WORKDIR "/home/postgres/onesparse"
COPY . .
ENV EDITOR zile
# make the extension
#RUN .virt/bin/python3 generate.py onesparse/onesparse--0.1.0.sql
RUN sudo make && sudo make install && sudo make clean
# start the database
RUN initdb -D "$PGDATA" \
-c shared_preload_libraries='onesparse' \
-c search_path='public,onesparse' \
-c onesparse.jit_control='on' \
--encoding UTF8
EXPOSE 5432
# wait forever
CMD tail -f /dev/null