-
Notifications
You must be signed in to change notification settings - Fork 406
/
Dockerfile
71 lines (61 loc) · 1.73 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
#
# Dockerfile
#
# @author hanjiang.yu@bitmain.com
# @copyright btc.com
# @since 2018-12-01
#
#
######### Build image #########
ARG BASE_IMAGE
FROM ${BASE_IMAGE} as build
LABEL maintainer="Hanjiang Yu <hanjiang.yu@bitmain.com>"
ARG GIT_DESCRIBE=""
ARG BUILD_JOBS=1
ARG BUILD_TESTING=ON
ARG BUILD_TYPE=Release
ARG WORK_WITH_STRATUM_SWITCHER=OFF
# Copy & build btcpool
COPY . /tmp/btcpool
RUN mkdir -p /tmp/build && cd /tmp/build && cmake \
-DBPOOL_GIT_DESCRIBE=${GIT_DESCRIBE} \
-DBUILD_TESTING=${BUILD_TESTING} \
-DCHAIN_SRC_ROOT=/work/blockchain \
-DCHAIN_TYPE=${CHAIN_TYPE} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DJOBS=${BUILD_JOBS} \
-DKAFKA_LINK_STATIC=ON \
-DPOOL__GENERATE_DEB_PACKAGE=ON \
-DPOOL__INSTALL_PREFIX=/work/btcpool \
-DPOOL__WORK_WITH_STRATUM_SWITCHER=${WORK_WITH_STRATUM_SWITCHER} \
/tmp/btcpool
RUN cd /tmp/build && make package -j${BUILD_JOBS} && mkdir -p /work/package && cp *.deb /work/package/
######### Release image #########
FROM ubuntu:18.04
LABEL maintainer="Hanjiang Yu <hanjiang.yu@bitmain.com>"
ARG APT_MIRROR_URL
COPY docker/btcpool/deploy/update_apt_sources.sh /tmp
RUN /tmp/update_apt_sources.sh
# Copy deb packages
COPY --from=build /work/package /work/package
# Install utilities & btcpool w/ debug symbols
RUN apt-get update && \
apt-get install -y \
busybox \
curl \
htop \
less \
net-tools \
tcpdump \
tcpflow \
telnet \
tmux && \
busybox --install -s && \
apt-get install -y /work/package/*-main.deb && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# startup scripts
COPY ./docker/btcpool/deploy/entrypoint.sh ./docker/btcpool/deploy/wait-for-it.sh /
# entrypoint
ENTRYPOINT ["/entrypoint.sh"]