-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM debian:stable-slim | ||
|
||
RUN useradd -r bitcoin \ | ||
&& apt-get update -y \ | ||
&& apt-get install -y curl gnupg \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ | ||
&& set -ex \ | ||
&& for key in \ | ||
B42F6819007F00F88E364FD4036A9C25BF357DD4 \ | ||
; do \ | ||
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ | ||
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ | ||
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \ | ||
done | ||
|
||
ENV GOSU_VERSION=1.10 | ||
|
||
RUN curl -o /usr/local/bin/gosu -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture) \ | ||
&& curl -o /usr/local/bin/gosu.asc -fSL https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc \ | ||
&& gpg --verify /usr/local/bin/gosu.asc \ | ||
&& rm /usr/local/bin/gosu.asc \ | ||
&& chmod +x /usr/local/bin/gosu | ||
|
||
ENV BITCOIN_VERSION=0.16.0 | ||
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin | ||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH | ||
|
||
RUN curl -SL https://bitcoin.org/laanwj-releases.asc | gpg --import \ | ||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc \ | ||
&& curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \ | ||
&& gpg --verify SHA256SUMS.asc \ | ||
&& grep " bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz\$" SHA256SUMS.asc | sha256sum -c - \ | ||
&& tar -xzf *.tar.gz -C /opt \ | ||
&& rm *.tar.gz *.asc | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
VOLUME ["/home/bitcoin/.bitcoin"] | ||
|
||
COPY bitcoin.conf /home/bitcoin/.bitcoin/bitcoin.conf | ||
|
||
EXPOSE 8332 8333 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["bitcoind"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
listen=0 | ||
prune=2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ $(echo "$1" | cut -c1) = "-" ]; then | ||
echo "$0: assuming arguments for bitcoind" | ||
|
||
set -- bitcoind "$@" | ||
fi | ||
|
||
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then | ||
mkdir -p "$BITCOIN_DATA" | ||
chmod 700 "$BITCOIN_DATA" | ||
chown -R bitcoin "$BITCOIN_DATA" | ||
|
||
echo "$0: setting data directory to $BITCOIN_DATA" | ||
|
||
set -- "$@" -datadir="$BITCOIN_DATA" | ||
fi | ||
|
||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then | ||
echo | ||
exec gosu bitcoin "$@" | ||
fi | ||
|
||
echo | ||
exec "$@" |