-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
97 lines (84 loc) · 2.42 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
# Get Ubuntu 16.04
FROM phusion/baseimage:0.10.1 AS build
# Set Variables
ENV DATADIR "/data"
ENV LANG=en_US.UTF-8
# Make Ports Available
EXPOSE 8090
EXPOSE 33333
RUN mkdir -p "${DATADIR}" /usr/local/bin
# EntryPoint for Config
CMD [ "/entrypoint.sh" ]
RUN \
apt-get update -y && \
apt-get install -y \
g++ \
autoconf \
cmake \
git \
libbz2-dev \
libcurl4-openssl-dev \
libssl-dev \
libncurses-dev \
libboost-thread-dev \
libboost-iostreams-dev \
libboost-date-time-dev \
libboost-system-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-chrono-dev \
libboost-test-dev \
libboost-context-dev \
libboost-regex-dev \
libboost-coroutine-dev \
libtool \
doxygen \
ca-certificates \
fish \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ADD . /SounDAC-Source
WORKDIR /SounDAC-Source
# Compile
RUN \
( git submodule sync --recursive || \
find `pwd` -type f -name .git | \
while read f; do \
rel="$(echo "${f#$PWD/}" | sed 's=[^/]*/=../=g')"; \
sed -i "s=: .*/.git/=: $rel/=" "$f"; \
done && \
git submodule sync --recursive ) && \
git submodule update --init --recursive && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
. && \
make mused cli_wallet get_dev_key && \
install -s programs/mused/mused programs/cli_wallet/cli_wallet programs/util/get_dev_key /usr/local/bin && \
install -d /etc/SounDAC && \
install -m 0644 Docker/config.ini /etc/SounDAC/ && \
install -m 0755 Docker/entrypoint.sh / && \
#
# Obtain version
git rev-parse --short HEAD > /etc/SounDAC/version && \
cd / && \
rm -rf /SounDAC-Source
#
# Build smaller runtime image
#
FROM phusion/baseimage:0.10.1
# Set Variables
ENV DATADIR "/data"
ENV LANG=en_US.UTF-8
# Make Ports Available
EXPOSE 8090
EXPOSE 33333
RUN mkdir -p "${DATADIR}" /usr/local/bin /etc/SounDAC
# EntryPoint for Config
CMD [ "/entrypoint.sh" ]
COPY --from=build /entrypoint.sh /entrypoint.sh
COPY --from=build /etc/SounDAC/config.ini /etc/SounDAC/config.ini
COPY --from=build /etc/SounDAC/version /etc/SounDAC/version
COPY --from=build /usr/local/bin/cli_wallet /usr/local/bin/cli_wallet
COPY --from=build /usr/local/bin/get_dev_key /usr/local/bin/get_dev_key
COPY --from=build /usr/local/bin/mused /usr/local/bin/mused