Skip to content

Commit

Permalink
Add debian dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbx committed Oct 29, 2023
1 parent ab3795c commit 22e50c0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
File renamed without changes.
60 changes: 60 additions & 0 deletions btc/node/docker/dockerfile.ubuntu
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" ]

0 comments on commit 22e50c0

Please sign in to comment.