forked from hstreamdb/hstream
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (59 loc) · 2.64 KB
/
Dockerfile
File metadata and controls
76 lines (59 loc) · 2.64 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
# ------------------------------------------------------------------------------
FROM hstreamdb/haskell:8.10 as dependencies-meta
COPY . /opt
WORKDIR /opt
RUN rm -rf /srv/* && \
cp /opt/cabal.project /srv/cabal.project && \
find . -type f -name "*.cabal" | xargs cp --parents -t /srv
# ------------------------------------------------------------------------------
FROM hstreamdb/haskell:8.10 as dependencies
ARG cabal_mirror_name="hackage.haskell.org"
ARG cabal_mirror_url="http://hackage.haskell.org/"
RUN cabal user-config init && echo "\
repository $cabal_mirror_name \n\
url: $cabal_mirror_url \n\
" > /root/.cabal/config && cabal user-config update && cabal update
COPY --from=dependencies-meta /srv /srv
RUN cd /srv && cabal update && cabal build --dependencies-only all
# ------------------------------------------------------------------------------
FROM hstreamdb/haskell:8.10 as builder
COPY --from=dependencies /srv/dist-newstyle /srv/dist-newstyle
COPY --from=dependencies /root/.cabal /root/.cabal
COPY . /srv
RUN cd /srv && cabal install hstream
# ------------------------------------------------------------------------------
FROM ubuntu:bionic
RUN apt-get update && apt-get install -y --no-install-recommends \
libunwind8 \
libdwarf1 \
libboost-dev \
libboost-chrono1.65.1 \
libboost-date-time1.65.1 \
libboost-atomic1.65.1 \
libboost-filesystem1.65.1 \
libboost-program-options1.65.1 \
libboost-regex1.65.1 \
libboost-thread1.65.1 \
libboost-python1.65.1 \
libboost-context-dev \
libssl-dev \
libevent-dev \
libevent-openssl-2.1-6 \
libdouble-conversion-dev \
libzookeeper-mt2 \
libgoogle-glog-dev \
libjemalloc1 \
libsnappy1v5 \
libpython3.6 \
libsodium-dev \
libzstd-dev \
&& rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=hstreamdb/logdevice-client:latest /usr/local/lib/ /usr/local/lib/
RUN ln -sr /usr/local/lib/librocksdb.so.6.6.1 /usr/local/lib/librocksdb.so.6 && \
ln -sr /usr/local/lib/librocksdb.so.6.6.1 /usr/local/lib/librocksdb.so
COPY --from=builder /root/.cabal/bin/hstream-server \
/root/.cabal/bin/hstream-client \
/usr/local/bin/
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
EXPOSE 6560 6570
CMD ["/usr/local/bin/hstream-server", "-p", "6570"]