forked from roshii/docker-cryptonodes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.erb
43 lines (36 loc) · 1.21 KB
/
Dockerfile.erb
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
RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget \
&& rm -rf /var/lib/apt/lists/*
ENV BITCOIN_VERSION <%= version %>
ENV BITCOIN_URL <%= url %>
ENV BITCOIN_SHA256 <%= sha256 %>
<% if asc_url -%>
ENV BITCOIN_ASC_URL <%= asc_url %>
ENV BITCOIN_PGP_KEY <%= key %>
<% end -%>
# install bitcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
<% if asc_url -%>
&& gpg --keyserver keyserver.ubuntu.com --recv-keys "$BITCOIN_PGP_KEY" \
&& wget -qO bitcoin.asc "$BITCOIN_ASC_URL" \
&& gpg --verify bitcoin.asc \
<% end -%>
&& tar -xzvf bitcoin.tar.gz -C /usr/local --strip-components=1 --exclude=*-qt \
&& rm -rf /tmp/*
# create data directory
ENV BITCOIN_DATA /data
RUN mkdir "$BITCOIN_DATA" \
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
VOLUME /data
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 8332 8333 18332 18333
CMD ["bitcoind"]