/
Dockerfile
79 lines (61 loc) · 2.11 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
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
FROM ubuntu:22.04 as build
ARG BRANCH=default
ARG CSET=2f570750dba6
# for building always the latest revision of a branch (e.g. default) use
# BRANCH for BASE otherwise pick up and use a certain changeset (CSET)
ARG BASE=${CSET}
# install monetdb build dependencies
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" \
TZ="Europe/Amsterdam" \
apt-get install -y cmake bison libpcre3-dev libssl-dev wget \
python3 libgdal-dev gdal-bin libgeos-dev \
libproj-dev unzip libcurl4-gnutls-dev \
readline-common libreadline-dev && \
rm -rf /var/lib/apt/lists/*
# download and extract monetdb
WORKDIR /tmp
RUN wget --no-check-certificate --content-disposition -O MonetDB.zip \
https://monetdb.org/hg/MonetDB/archive/${BASE}.zip
RUN unzip MonetDB.zip
RUN mkdir /tmp/MonetDB-${BASE}/build
WORKDIR /tmp/MonetDB-${BASE}/build
RUN cmake .. \
-DWITH_CRYPTO=OFF \
-DINT128=ON \
-DPY3INTEGRATION=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DASSERT=OFF \
-DSTRICT=OFF \
-DRINTEGRATION=OFF \
-DGEOM=ON \
-DSHP=ON
RUN cmake --build . -j
RUN cmake --build . --target install
FROM ubuntu:22.04 as runtime
# install monetdb runtime dependencies
# TODO: which of these dependencies is actually necessary?
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" \
TZ="Europe/Amsterdam" \
apt-get install -y libcurl4-gnutls-dev readline-common \
libpcre3 libssl3 libgdal-dev \
gdal-bin libgeos-dev && \
rm -rf /var/lib/apt
# copy MonetDB install from build container
RUN rm -rf /usr/local
COPY --from=build /usr/local /usr/local
# start init script directory
RUN mkdir /initdb
# set env variables defaults
ENV DB_FARM=/var/monetdb5/dbfarm
ENV DB_NAME=vesselai
ENV DB_USER=monetdb
ENV DB_PASSWORD=monetdb
ENV DB_PASSWORD_FILE=NO_FILE
# copy start script and run it
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 50000
ENTRYPOINT /usr/local/bin/entrypoint.sh ${DB_FARM} \
${DB_NAME} ${DB_USER} ${DB_PASSWORD} ${DB_PASSWORD_FILE}