Skip to content

Commit

Permalink
Version 0.1. See CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Git committed Aug 19, 2023
1 parent d63dae1 commit f4dbb51
Show file tree
Hide file tree
Showing 8 changed files with 778 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 2023/08/19
## Version 0.1
* Initial release
77 changes: 77 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM alpine:latest as build

#
# First get all the packages for
# the compile
#
RUN apk update && apk add git \
make \
file \
autoconf \
automake \
build-base \
libtool \
db-c++ \
db-dev \
boost-system \
boost-program_options \
boost-filesystem \
boost-dev \
libressl-dev \
libevent-dev

#
# Pull source code from bitcoin GitHub
#
RUN git clone https://github.com/bitcoin/bitcoin --branch master --single-branch

#
# Install the required packages to compile the bitcoin binaries.
#
RUN (cd bitcoin && ./autogen.sh && \
./configure --disable-tests \
--disable-bench --disable-static \
--without-gui --disable-zmq \
--with-incompatible-bdb \
CFLAGS='-w' CXXFLAGS='-w' && \
make -j 16 && \
strip src/bitcoind && \
strip src/bitcoin-cli && \
strip src/bitcoin-tx && \
make install )

FROM alpine:latest

#
# Copy the binaries from the build to our new container
#
COPY --from=build /usr/local/bin/bitcoind /usr/local/bin
COPY --from=build /usr/local/bin/bitcoin-cli /usr/local/bin

#
# Install all dependencies
#
RUN apk update && apk add boost boost-filesystem \
boost-program_options \
boost-system boost-thread busybox db-c++ \
libevent libgcc libressl3.6-libcrypto \
libstdc++ musl tor vim shadow

#
# Copy entrypoint.sh script, set required permissions for entrypoint.sh
# Create the bitcoin user (uid 100000) and bitcoin group (gid 100000)
#
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && chown root.root /entrypoint.sh
RUN /usr/sbin/groupadd -g 100000 bitcoin && /usr/sbin/useradd -u 100000 -g 100000 bitcoin

# Expose the bitcoin-core TCP port 8333
EXPOSE 8333/tcp

# Set the user to bitcoin
USER bitcoin

#
# Start the bitcoin server
#
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# docker-bitcoin-core
A set of scripts to run a bitcoin-core binary within a docker container.
A set of scripts to run a bitcoin-core binary within a docker container.

For more information on how to work with these scripts, refer to this blog [post](https://nolanrumble.com/security/?p=176)
Loading

0 comments on commit f4dbb51

Please sign in to comment.