diff --git a/code/docker/bitcoind-base/Dockerfile b/code/docker/bitcoind-base/Dockerfile deleted file mode 100644 index 72f97e2..0000000 --- a/code/docker/bitcoind-base/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM ubuntu:18.04 AS bitcoind-base - -ENV BITCOIND_VERSION 0.20.0 - -# Install binaries for Bitcoin Core -ADD https://bitcoincore.org/bin/bitcoin-core-${BITCOIND_VERSION}/bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz /usr/local -RUN cd /usr/local/ \ - && tar -zxf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz \ - && cd bitcoin-${BITCOIND_VERSION} \ - && install bin/* /usr/local/bin \ - && install include/* /usr/local/include \ - && install -v lib/* /usr/local/lib - -# Confirm installation -RUN bitcoind -version diff --git a/code/docker/bitcoind-regtest/Dockerfile b/code/docker/bitcoind-regtest/Dockerfile index 21f49ea..e7acfa8 100644 --- a/code/docker/bitcoind-regtest/Dockerfile +++ b/code/docker/bitcoind-regtest/Dockerfile @@ -1,4 +1,32 @@ -FROM lnbook/bitcoind-base:latest +FROM ubuntu:18.04 AS bitcoind-base + +# RUN apk update \ +# && apk upgrade \ +# && apk add bash bash-completion + +RUN apt update \ + && apt install -y \ + bash-completion + +ENV BITCOIND_VERSION 0.20.0 +# Install binaries for Bitcoin Core +ADD https://bitcoincore.org/bin/bitcoin-core-${BITCOIND_VERSION}/bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz /usr/local +RUN cd /usr/local/ \ + && tar -zxf bitcoin-${BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz \ + && cd bitcoin-${BITCOIND_VERSION} \ + && install bin/* /usr/local/bin \ + && install include/* /usr/local/include \ + && install -v lib/* /usr/local/lib + +ENV GH_URL https://raw.githubusercontent.com/bitcoin/bitcoin/master/ +ENV BC /usr/share/bash-completion/completions/ +ADD $GH_URL/contrib/bitcoin-cli.bash-completion $BC/bitcoin-cli +ADD $GH_URL/contrib/bitcoind.bash-completion $BC/bitcoind +ADD $GH_URL/contrib/bitcoin-tx.bash-completion $BC/bitcoin-tx + +ADD bashrc /root/.bashrc + +FROM bitcoind-base AS bitcoind-regtest ADD bitcoind /bitcoind RUN ln -s /bitcoind /root/.bitcoin diff --git a/code/docker/bitcoind-regtest/bashrc b/code/docker/bitcoind-regtest/bashrc new file mode 100644 index 0000000..7062b7c --- /dev/null +++ b/code/docker/bitcoind-regtest/bashrc @@ -0,0 +1,3 @@ +# Use bash-completion, if available +[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \ + . /usr/share/bash-completion/bash_completion diff --git a/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf index d9a6c3c..36d6903 100644 --- a/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf +++ b/code/docker/bitcoind-regtest/bitcoind/bitcoin.conf @@ -2,6 +2,7 @@ regtest=1 server=1 debuglogfile=debug.log debug=1 +txindex=1 printtoconsole=0 [regtest] diff --git a/code/docker/btc-explorer/Dockerfile b/code/docker/btc-explorer/Dockerfile new file mode 100644 index 0000000..d5b3ce1 --- /dev/null +++ b/code/docker/btc-explorer/Dockerfile @@ -0,0 +1,5 @@ +FROM node:12-alpine + +WORKDIR /usr/src/btc-explorer + +RUN npm install git+https://git@github.com/janoside/btc-rpc-explorer.git diff --git a/code/docker/lnd-base/Dockerfile b/code/docker/lnd-base/Dockerfile deleted file mode 100644 index 3771ad2..0000000 --- a/code/docker/lnd-base/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM golang:1.13 - -ENV GOPATH /go -WORKDIR $GOPATH/src - -RUN apt update && apt install -y \ - jq - -# LND -RUN go get -d github.com/lightningnetwork/lnd -WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd -RUN make && make install diff --git a/code/docker/lnd-run/Dockerfile b/code/docker/lnd-run/Dockerfile index f3af728..e60af3c 100644 --- a/code/docker/lnd-run/Dockerfile +++ b/code/docker/lnd-run/Dockerfile @@ -1,4 +1,17 @@ -FROM lnbook/lnd-base +FROM golang:1.13 as lnd-base + +ENV GOPATH /go +WORKDIR $GOPATH/src + +RUN apt update && apt install -y \ + jq + +# LND +RUN go get -d github.com/lightningnetwork/lnd +WORKDIR $GOPATH/src/github.com/lightningnetwork/lnd +RUN make && make install + +FROM lnd-base AS lnd-run ADD lnd /lnd RUN ln -s /lnd /root/.lnd