-
Notifications
You must be signed in to change notification settings - Fork 1
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
13 changed files
with
194 additions
and
14 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,33 @@ | ||
FROM debian:stable-slim | ||
|
||
ARG BITCOIN_VERSION=28.0 | ||
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH | ||
|
||
RUN apt-get update -y \ | ||
&& apt-get install -y curl gosu \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN SYS_ARCH="$(uname -m)" \ | ||
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${SYS_ARCH}-linux-gnu.tar.gz \ | ||
&& tar -xzf *.tar.gz -C /opt \ | ||
&& rm *.tar.gz | ||
|
||
RUN curl -SLO https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/bitcoin-cli.bash-completion \ | ||
&& mkdir /etc/bash_completion.d \ | ||
&& mv bitcoin-cli.bash-completion /etc/bash_completion.d/ \ | ||
&& curl -SLO https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion \ | ||
&& mv bash_completion /usr/share/bash-completion/ | ||
|
||
COPY docker-entrypoint.sh /entrypoint.sh | ||
COPY bashrc /home/bitcoin/.bashrc | ||
|
||
RUN chmod a+x /entrypoint.sh | ||
|
||
VOLUME ["/home/bitcoin/.bitcoin"] | ||
|
||
EXPOSE 18443 18444 28334 28335 | ||
|
||
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,8 @@ | ||
# enable bash completion in interactive shells | ||
if ! shopt -oq posix; then | ||
if [ -f /usr/share/bash-completion/bash_completion ]; then | ||
. /usr/share/bash-completion/bash_completion | ||
elif [ -f /etc/bash_completion ]; then | ||
. /etc/bash_completion | ||
fi | ||
fi |
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,29 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# containers on linux share file permissions with hosts. | ||
# assigning the same uid/gid from the host user | ||
# ensures that the files can be read/write from both sides | ||
if ! id bitcoin > /dev/null 2>&1; then | ||
USERID=${USERID:-1000} | ||
GROUPID=${GROUPID:-1000} | ||
|
||
echo "adding user bitcoin ($USERID:$GROUPID)" | ||
groupadd -f -g $GROUPID bitcoin | ||
useradd -r -u $USERID -g $GROUPID bitcoin | ||
chown -R $USERID:$GROUPID /home/bitcoin | ||
fi | ||
|
||
if [ $(echo "$1" | cut -c1) = "-" ]; then | ||
echo "$0: assuming arguments for bitcoind" | ||
|
||
set -- bitcoind "$@" | ||
fi | ||
|
||
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then | ||
echo "Running as bitcoin user: $@" | ||
exec gosu bitcoin "$@" | ||
fi | ||
|
||
echo "$@" | ||
exec "$@" |
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
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
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
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
Oops, something went wrong.