forked from kawkawcoin/kawkawcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (46 loc) · 1.84 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
FROM amd64/ubuntu:18.04 AS base
EXPOSE 9090/tcp
EXPOSE 9099/tcp
ENV DEBIAN_FRONTEND=noninteractive
#Add ppa:bitcoin/bitcoin repository so we can install libdb4.8 libdb4.8++
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:bitcoin/bitcoin
#Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash net-tools libminiupnpc10 \
libevent-2.1 libevent-pthreads-2.1 \
libdb4.8 libdb4.8++ \
libboost-system1.65 libboost-filesystem1.65 libboost-chrono1.65 \
libboost-program-options1.65 libboost-thread1.65 \
libzmq5 && \
apt-get clean
FROM base AS build
#Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash net-tools build-essential libtool autotools-dev automake git \
pkg-config libssl-dev libevent-dev bsdmainutils python3 \
libboost-system1.65-dev libboost-filesystem1.65-dev libboost-chrono1.65-dev \
libboost-program-options1.65-dev libboost-test1.65-dev libboost-thread1.65-dev \
libzmq3-dev libminiupnpc-dev libdb4.8-dev libdb4.8++-dev && \
apt-get clean
#Build Kawkaw from source
COPY . /home/kawkaw/build/Kawkaw/
WORKDIR /home/kawkaw/build/Kawkaw
RUN ./autogen.sh && ./configure --disable-tests --with-gui=no && make
FROM base AS final
#Add our service account user
RUN useradd -ms /bin/bash kawkaw && \
mkdir /var/lib/kawkaw && \
chown kawkaw:kawkaw /var/lib/kawkaw && \
ln -s /var/lib/kawkaw /home/kawkaw/.kawkaw && \
chown -h kawkaw:kawkaw /home/kawkaw/.kawkaw
VOLUME /var/lib/kawkaw
#Copy the compiled binaries from the build
COPY --from=build /home/kawkaw/build/Kawkaw/src/kawkawd /usr/local/bin/kawkawd
COPY --from=build /home/kawkaw/build/Kawkaw/src/kawkaw-cli /usr/local/bin/kawkaw-cli
WORKDIR /home/kawkaw
USER kawkaw
CMD /usr/local/bin/kawkawd -datadir=/var/lib/kawkaw -printtoconsole -onlynet=ipv4