-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (38 loc) · 1.63 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
FROM debian:stretch-slim
ENV BITCOIN_VERSION_FAMILY 0.19
ENV BITCOIN_VERSION 0.19.6
ENV BITCOIN_URL https://download.bitcoinabc.org/$BITCOIN_VERSION/linux/bitcoin-abc-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz
# get bitcoin-abc sha here: https://download.bitcoinabc.org/$BITCOIN_VERSION/linux/bitcoin-abc-$BITCOIN_VERSION_FAMILY-linux-res.yml
ENV BITCOIN_SHA256 b84aad1c0061fcafdef1b89cb75e2fc79be8f0a872fad8b1c40eebe59652a2d2
# Vars related to data directory creation
ENV BITCOIN_DATA /data
COPY docker-entrypoint.sh /entrypoint.sh
COPY rabbitmqadmin /usr/bin/rabbitmqadmin
COPY google-logger /usr/bin/google-logger
RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin \
&& set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget python-setuptools python-pip procps htop\
&& rm -rf /var/lib/apt/lists/* \
# run pip
&& pip install --upgrade google-cloud-logging \
&& pip install --upgrade grpcio==1.7.3 \
# install bitcoin binaries
&& set -ex \
&& cd /tmp \
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
&& tar -xzvf bitcoin.tar.gz -C /usr/local --strip-components=1 --exclude=*-qt \
&& rm -rf /tmp/* \
# create data directory
&& mkdir "$BITCOIN_DATA" \
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin \
# set permissions to files
&& chmod +x /usr/bin/rabbitmqadmin \
&& chmod +x /usr/bin/google-logger
VOLUME /data
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 8332 8333 18332 18333
CMD ["bitcoind"]