This Dockerfile is based on the Dockerfile officially provided within the lnd repo.
The changes from upstream include:
- exact versions of base images specified,
makereplaced with nakedgo build,apk addremoved from thefinalstage of the build to make cross-compilation possible,- maintainer label added.
latest,0.5.2- currently latest version of lnd for botharmandamd640.5.2-linux-arm- LND version 0.5.2 forarmarchitecture, built on Travis (log)0.5.2-linux-amd64- LND version 0.5.2 foramd64architecture, built on Travis (log)
First pull the image from Docker Hub:
docker pull lncm/lnd:0.5.2NOTE: Running above will automatically choose native architecture of your CPU.
Then to start lnd, execute:
docker run -it --rm \
-v ~/.lnd:/root/.lnd \
-p 9735:9735 \
-p 10009:10009 \
--name lnd \
--detach \
lncm/lnd:0.5.2That will run lnd such that:
- all data generated by the container is stored in
~/.lndon your host machine, - port
9735will be reachable for the peer-to-peer communication, - port
10009will be reachable for the RPC communication, - created container will get named
lnd, - that command will run the container in the background and print the ID of the container being run.
To issue any commands to a running container, do:
docker exec -it lnd BINARY COMMANDWhere:
BINARYis eitherlndorlncli, andCOMMANDis something you'd normally pass to the binary
Examples:
docker exec -it lnd lnd --help
docker exec -it lnd lnd --version
docker exec -it lnd lncli --help
docker exec -it lnd lncli getinfo
docker exec -it lnd lncli getnetworkinfo