Docker consolidation and cleanup

Converted to multi-stage builds and improved startup handling
pull/238/head
Andreas M. Antonopoulos 4 years ago
parent 28f91cb4b4
commit 73bf225708

@ -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

@ -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

@ -0,0 +1,3 @@
# Use bash-completion, if available
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
. /usr/share/bash-completion/bash_completion

@ -2,6 +2,7 @@ regtest=1
server=1
debuglogfile=debug.log
debug=1
txindex=1
printtoconsole=0
[regtest]

@ -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

@ -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

@ -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

Loading…
Cancel
Save