-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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,60 @@ | ||
# syntax = docker/dockerfile:1 | ||
# Author: Andrew ([email protected]) | ||
|
||
FROM ubuntu:latest AS build.bitcoin.node | ||
MAINTAINER Andrew <[email protected]> | ||
|
||
USER root | ||
|
||
# Setup git vars. | ||
|
||
ENV GIT_SSH=/tmp/ssh | ||
ENV GIT_TRACE=1 | ||
|
||
# Setup ubuntu image. | ||
|
||
RUN apt update && apt install -y build-essential libtool autotools-dev automake \ | ||
pkg-config bsdmainutils python3 libssl-dev libevent-dev \ | ||
libboost-all-dev libminiupnpc-dev libzmq3-dev git libsqlite3-dev ccache | ||
|
||
# Compile bitcoin. | ||
|
||
RUN git clone https://github.com/bitcoin/bitcoin.git | ||
|
||
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 4 && \ | ||
strip src/bitcoind && \ | ||
strip src/bitcoin-cli && \ | ||
strip src/bitcoin-tx && \ | ||
make install ) | ||
|
||
FROM ubuntu:latest | ||
|
||
# Copy bitcoin binary to new container. | ||
|
||
COPY --from=build.bitcoin.node /usr/local/bin/bitcoind /usr/local/bin | ||
|
||
# Install dependencies. | ||
|
||
RUN apt update && apt install -y libtool \ | ||
pkg-config bsdmainutils python3 openssl \ | ||
libboost-all-dev ccache | ||
|
||
# Bitcoin node configuration. | ||
|
||
ADD ./config/bitcoin.conf /bitcoin.conf | ||
|
||
# Expose RPC port. | ||
|
||
EXPOSE 8332/tcp | ||
EXPOSE 8333/tcp | ||
|
||
# Start the bitcoin server. | ||
|
||
ENTRYPOINT ["/usr/local/bin/bitcoind"] | ||
CMD ["-conf=/bitcoin.conf", "-regtest", "-rest=1", "-server=1", "-printtoconsole", "-txindex=1", "-datadir=/node/data" ] |