Switching to using Dockerfile from Docker Hub

This commit is contained in:
rockstardev 2018-05-01 21:12:04 -05:00
parent fcfba7f5e1
commit cfbcf0947a
4 changed files with 1 additions and 91 deletions

View File

@ -181,7 +181,7 @@ services:
- "5432"
lnd:
image: testing_lnd
image: btcpayserver/lnd:0.4.1.0
environment:
RPCHOST: bitcoind:43782
RPCUSER: ceiwHEbqWI83

View File

@ -1,25 +0,0 @@
FROM golang:1.10
MAINTAINER BtcPayServer <btcpayserver@github.com>
# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
ENV GODEBUG netdns=cgo
# Install dep to manage vendor.
RUN go get -u github.com/golang/dep/cmd/dep
# Grab and install the latest version of lnd and all related dependencies.
RUN git clone -b dev https://github.com/btcpayserver/lnd $GOPATH/src/github.com/btcpayserver/lnd
# Make lnd folder default.
WORKDIR $GOPATH/src/github.com/btcpayserver/lnd
# Install dependencies and install/build lnd.
RUN dep ensure
RUN go install . ./cmd/...
COPY "start-lnd.sh" .
RUN chmod +x start-lnd.sh
ENTRYPOINT ["./start-lnd.sh"]

View File

@ -1 +0,0 @@
docker build -t testing_lnd .

View File

@ -1,64 +0,0 @@
#!/usr/bin/env bash
# exit from script if error was raised.
set -e
# error function is used within a bash function in order to send the error
# message directly to the stderr output and exit.
error() {
echo "$1" > /dev/stderr
exit 0
}
# return is used within bash function in order to return the value.
return() {
echo "$1"
}
# set_default function gives the ability to move the setting of default
# env variable from docker file to the script thereby giving the ability to the
# user override it durin container start.
set_default() {
# docker initialized env variables with blank string and we can't just
# use -z flag as usually.
BLANK_STRING='""'
VARIABLE="$1"
DEFAULT="$2"
if [[ -z "$VARIABLE" || "$VARIABLE" == "$BLANK_STRING" ]]; then
if [ -z "$DEFAULT" ]; then
error "You should specify default variable"
else
VARIABLE="$DEFAULT"
fi
fi
return "$VARIABLE"
}
# Set default variables if needed.
RPCHOST=$(set_default "$RPCHOST" "127.0.0.1:43782")
RPCUSER=$(set_default "$RPCUSER" "devuser")
RPCPASS=$(set_default "$RPCPASS" "devpass")
ZMQPATH=$(set_default "$ZMQPATH" "tcp://127.0.0.1:28332")
DEBUG=$(set_default "$DEBUG" "debug")
NETWORK=$(set_default "$NETWORK" "regtest")
CHAIN=$(set_default "$CHAIN" "bitcoin")
BACKEND=$(set_default "$BACKEND" "bitcoind")
exec lnd \
--no-macaroons \
--noencryptwallet \
--logdir="/data" \
"--$CHAIN.active" \
"--$CHAIN.$NETWORK" \
"--$CHAIN.node"="$BACKEND" \
"--$BACKEND.rpchost"="$RPCHOST" \
"--$BACKEND.rpcuser"="$RPCUSER" \
"--$BACKEND.rpcpass"="$RPCPASS" \
"--$BACKEND.zmqpath"="$ZMQPATH" \
"--restlisten=0.0.0.0:8080" \
--debuglevel="$DEBUG" \
"$@"