-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.static.zmq
49 lines (42 loc) · 2.01 KB
/
Dockerfile.static.zmq
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
# syntax=docker/dockerfile:1
FROM debian as prep
RUN apt update && apt -y upgrade && apt install --no-install-recommends --yes wget ca-certificates autoconf automake pkg-config libtool
WORKDIR /opt
RUN wget -qO- https://bitcoincore.org/bin/bitcoin-core-23.0/bitcoin-23.0.tar.gz | tar xzf - && \
mv bitcoin-23.0 bitcoin && \
cd bitcoin && \
./autogen.sh
FROM debian as builder-base
RUN apt update && apt -y upgrade && apt install --yes --no-install-recommends make g++ binutils
FROM builder-base as builder-depends
COPY --from=prep /opt/bitcoin /opt/bitcoin
RUN \
apt install --yes --no-install-recommends \
# For Boost, libevent
curl ca-certificates lbzip2 \
# For ZeroMQ
patch autoconf automake libtool pkg-config
WORKDIR /opt/bitcoin/depends
RUN make NO_QT=1 NO_QR=1 NO_WALLET=1 NO_BDB=1 NO_SQLITE=1 NO_UPNP=1 NO_NATPMP=1 NO_USDT=1
FROM builder-base as builder
COPY --from=prep /opt/bitcoin /opt/bitcoin
COPY --from=builder-depends /opt/bitcoin/depends/x86_64-pc-linux-gnu /opt/bitcoin/depends/x86_64-pc-linux-gnu
RUN apt install --yes --no-install-recommends pkg-config
WORKDIR /opt/bitcoin
RUN LDFLAGS="-static-libstdc++" ./configure \
--prefix=`pwd`/depends/x86_64-pc-linux-gnu \
--without-wallet --without-sqlite --without-bdb --without-gui --without-libs \
--disable-tests --disable-bench --disable-external-signer \
--enable-daemon --disable-util-cli --disable-util-tx --disable-util-wallet --disable-util-util && \
make install
FROM scratch as deps
COPY --from=debian /lib/x86_64-linux-gnu/libpthread.so.0 /lib/libpthread.so.0
COPY --from=debian /lib/x86_64-linux-gnu/libm.so.6 /lib/libm.so.6
COPY --from=debian /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/libgcc_s.so.1
COPY --from=debian /lib/x86_64-linux-gnu/libc.so.6 /lib/libc.so.6
COPY --from=debian /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2
FROM scratch as daemon
COPY --from=deps / /
COPY --from=builder /opt/bitcoin/depends/x86_64-pc-linux-gnu/bin/bitcoind /bin/bitcoind
VOLUME /.bitcoin
ENTRYPOINT ["/bin/bitcoind"]