docker: revamp docker set up to allow for an LN test cluster

This commit revamps the existing docker configuration to allow for
developer’s to easily bring up/down a Lightning Network testbed
environment.

Configuration related bugs within the prior swarm set up have been
fixed. The launched lnd nodes are now able to properly communicate with
the primary btcd node over RPC. The auto-generated RPC script has been
scrapped in favor of hard-coding a developer-only set of RPC
credentials. With this change, it’s now possible to add/remove
additional lnd nodes in order to test more complex scenarios.

Additionally, the containers now build off of the latest Go version
(1.7).
This commit is contained in:
Olaoluwa Osuntokun committed 2016-08-29 15:18:04 -07:00
1 parent 4e416da4cd
commit 9a4a52ed89
6 files changed
+61 -87

No files matched your search

+21 -5
View File
@@ -1,14 +1,30 @@
FROM golang:1.6.2
FROM golang:1.7
MAINTAINER Olaoluwa Osuntokun <laolu@lightning.network>
# Grab and install the latest version of lnd and all related dependencies.
# TODO(roasbeef): replace with glide install
RUN go get -u -v github.com/lightningnetwork/lnd/...
# TODO(roasbeef): just mount a volume from the build context to the GOPATH?
ADD . /go/src/github.com/lightningnetwork/lnd
WORKDIR /go/src/github.com/lightningnetwork/lnd
# 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
RUN go build
RUN go install . ./cmd/...
# Mount a volume where btcd's RPC credentials are stored. We'll need to read
# the TLS cert from this directory.
VOLUME ["/rpc"]
VOLUME ["/data"]
# Expose the p2p listening port, and the current RPC port.
EXPOSE 10009 10011
ENTRYPOINT ["/go/bin/lnd", "--datadir=/data", "--logdir=/data", "--segnet", "--btcdhost=btcd", "--rpccert=/data/rpc.cert"]
COPY docker/lnd/lnd-start.sh /
# Finally, execute the shell script that will start lnd. We use a shell script
# rather than executing the command directly with ENTRYPOINT in order to ensure
# environment variables get properly substitued.
ENTRYPOINT ["/lnd-start.sh"]