-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (57 loc) · 1.67 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
ARG BDB_VERSION="4.8.30.NC"
FROM lepetitbloc/bdb:$BDB_VERSION
LABEL maintainer="johan@lepetitbloc.net"
ARG USE_UPNP=1
ARG WALLET="saros"
ARG BASE_DIR=".saroscore/"
ARG CONFIG_FILE="saros.conf"
ARG PORT=8992
ARG RPC_PORT=9891
ARG REPOSITORY="https://github.com/sarospay/saros.git"
ARG REF="tags/1.0.1.3"
ENV USE_UPNP=$USE_UPNP \
WALLET=$WALLET \
BASE_DIR=$BASE_DIR \
CONFIG_FILE=$CONFIG_FILE \
PORT=$PORT \
RPC_PORT=$RPC_PORT
EXPOSE $PORT $RPC_PORT
RUN apt-get update -y && apt-get install -y \
libssl-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-chrono-dev \
libboost-program-options-dev \
libboost-test-dev \
libboost-thread-dev \
libminiupnpc-dev \
libgmp-dev \
libevent-dev \
libzmq3-dev \
automake \
pkg-config \
git \
bsdmainutils \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -lrUm $WALLET \
&& git clone $REPOSITORY /tmp/$WALLET
WORKDIR /tmp/$WALLET
# build
RUN git fetch --tags \
&& git checkout $REF \
&& chmod +x autogen.sh share/genbuild.sh src/leveldb/build_detect_platform \
&& ./autogen.sh \
&& ./configure CPPFLAGS="-I/usr/local/db4/include -O2" LDFLAGS="-L/usr/local/db4/lib" \
&& make \
&& strip src/${WALLET}d src/${WALLET}-cli src/${WALLET}-tx \
&& mv src/${WALLET}d /usr/local/bin/ \
&& mv src/${WALLET}-cli /usr/local/bin/ \
&& mv src/${WALLET}-tx /usr/local/bin/ \
&& rm -rf /tmp/$WALLET
USER $WALLET
WORKDIR /home/$WALLET
RUN mkdir -p data $BASE_DIR
COPY wallet/${BASE_DIR}masternode.conf ${BASE_DIR}masternode.conf
COPY wallet/$BASE_DIR$CONFIG_FILE $BASE_DIR$CONFIG_FILE
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]