-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
115 lines (99 loc) · 3.89 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
FROM ubuntu:16.04
MAINTAINER Yoshiyuki Ieyama <44uk@github.com>
WORKDIR /tmp
RUN sed -i.bak -e "s%http://[^ ]\+%http://linux.yz.yamagata-u.ac.jp/ubuntu/%g" /etc/apt/sources.list
RUN apt-get update -y && apt-get upgrade -y && apt-get clean && apt-get install -y --no-install-recommends \
git \
curl \
wget \
vim \
autoconf \
automake \
apt-file \
build-essential \
software-properties-common \
pkg-config \
python3 \
libc6-dev \
libssl-dev \
libsasl2-dev \
libtool \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# gcc,g++ 7
RUN add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update && apt-get install -y --no-install-recommends gcc-7 g++-7 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& rm /usr/bin/gcc /usr/bin/g++ \
&& ln -s /usr/bin/gcc-7 /usr/bin/gcc \
&& ln -s /usr/bin/g++-7 /usr/bin/g++
# cmake
RUN git clone https://gitlab.kitware.com/cmake/cmake.git -b v3.11.1 --depth 1 \
&& cd cmake \
&& ./bootstrap --prefix=/usr/local && make -j4 && make install \
&& cd -
# boost
RUN wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz \
&& tar xzf boost_1_65_1.tar.gz && cd boost_1_65_1 \
&& ./bootstrap.sh && ./b2 toolset=gcc install --prefix=/usr/local -j4 \
&& cd -
# gtest
RUN git clone https://github.com/google/googletest.git -b release-1.8.0 --depth 1 \
&& mkdir -p googletest/_build && cd googletest/_build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j4 && make install \
&& cd -
# rocksdb
RUN git clone https://github.com/facebook/rocksdb.git -b v5.12.4 --depth 1 \
&& mkdir -p rocksdb/_build && cd rocksdb/_build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j4 && make install \
&& cd -
# zmqlib
RUN git clone https://github.com/zeromq/libzmq.git -b v4.2.3 --depth 1 \
&& mkdir -p libzmq/_build && cd libzmq/_build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j4 && make install \
&& cd -
# cppzmq
RUN git clone https://github.com/zeromq/cppzmq.git -b v4.2.3 --depth 1 \
&& mkdir -p cppzmq/_build && cd cppzmq/_build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && make -j4 && make install \
&& cd -
# mongo-c
RUN git clone https://github.com/mongodb/mongo-c-driver.git -b 1.4.3 --depth 1 && cd mongo-c-driver \
&& ./autogen.sh && ./configure --disable-automatic-init-and-cleanup --prefix=/usr/local \
&& make -j4 && make install \
&& cd -
#RUN wget https://github.com/mongodb/mongo-c-driver/releases/download/1.4.2/mongo-c-driver-1.4.2.tar.gz \
# && tar xzf mongo-c-driver-1.4.2.tar.gz && cd mongo-c-driver-1.4.2 \
# && ./configure --disable-automatic-init-and-cleanup --prefix=/usr/local \
# && make -j4 && make install \
# && cd -
# mongo-cxx
RUN git clone https://github.com/mongodb/mongo-cxx-driver.git -b r3.0.2 --depth 1 && cd mongo-cxx-driver/build \
&& cmake -DBSONCXX_POLY_USE_BOOST=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. \
&& make -j4 && make install \
&& cd -
# catapult
RUN git clone https://github.com/nemtech/catapult-server.git -b master --depth 1 \
&& cd catapult-server \
&& mkdir _build && cd _build \
&& cmake -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCMAKE_CXX_FLAGS="-pthread" \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DBSONCXX_LIB=/usr/local/lib/libbsoncxx.so \
-DMONGOCXX_LIB=/usr/local/lib/libmongocxx.so \
.. \
&& make publish && make -j4
# ------------------------------------
# ここから先は作業用に都合よくやっている
# 行儀が良いとは思ってないよ
COPY patch/config-user.patch .
RUN cd catapult-server \
&& patch -p1 < /tmp/config-user.patch \
&& mkdir -p seed/mijin-test \
&& mkdir data \
&& cd _build \
&& mv resources resources.bk \
&& cp -r ../resources .
# generate nemesis block
# && ./bin/catapult.tools.nemgen ../tools/nemgen/resources/mijin-test.properties \
# && cp -r ../seed/mijin-test/00000 ../data/
WORKDIR catapult-server/_build