-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
93 lines (76 loc) · 2.31 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
# From https://github.com/ruimarinho/docker-bitcoin-core
# Build stage for BerkeleyDB
FROM lncm/berkeleydb as berkeleydb
# Build stage for Bitcoin Core
FROM alpine:3.18 as bitcoin-core
COPY --from=berkeleydb /opt /opt
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
autoconf \
automake \
boost-dev \
build-base \
clang \
chrpath \
file \
gnupg \
libevent-dev \
libressl \
libtool \
linux-headers \
sqlite-dev \
zeromq-dev
ADD ./bitcoin /bitcoin
ENV BITCOIN_PREFIX=/opt/bitcoin
WORKDIR /bitcoin
RUN ./autogen.sh
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
# If building on Mac make sure to increase Docker VM memory, or uncomment this line. See https://github.com/bitcoin/bitcoin/issues/6658 for more info.
# CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" \
CXXFLAGS="-O1" \
CXX=clang++ CC=clang \
--prefix=${BITCOIN_PREFIX} \
--disable-man \
--disable-tests \
--disable-bench \
--disable-ccache \
--with-gui=no \
--with-utils \
--with-libs \
--with-sqlite=yes \
--with-daemon
RUN make -j$(nproc)
RUN make install
RUN strip ${BITCOIN_PREFIX}/bin/*
# Build stage for compiled artifacts
FROM alpine:3.18
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
maintainer.1="Pedro Branco (@pedrobranco)" \
maintainer.2="Rui Marinho (@ruimarinho)" \
maintainer.3="Aiden McClelland (@dr-bonez)"
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
RUN apk --no-cache add \
bash \
curl \
libevent \
libzmq \
sqlite-dev \
tini \
yq \
RUN rm -rf /var/cache/apk/*
ARG ARCH
ENV BITCOIN_DATA=/root/.bitcoin
ENV BITCOIN_PREFIX=/opt/bitcoin
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
COPY --from=bitcoin-core /opt /opt
COPY ./manager/target/${ARCH}-unknown-linux-musl/release/bitcoind-manager \
./docker_entrypoint.sh \
./actions/reindex.sh \
./actions/reindex_chainstate.sh \
./check-rpc.sh \
./check-synced.sh \
/usr/local/bin/
RUN chmod a+x /usr/local/bin/bitcoind-manager \
/usr/local/bin/*.sh
EXPOSE 8332 8333
ENTRYPOINT ["/usr/local/bin/docker_entrypoint.sh"]