-
Notifications
You must be signed in to change notification settings - Fork 51
Building the Bananode Docker image
Docker is an effective and easy method of running a bananode. To do this, you need to install docker, obtain an image or build one yourself, and finally run the containers.
To build the docker image you will also need to install git.
The docker-ce distribution is recommended. Test with your install with docker run hello-world
.
Either:
a) Pull the built image from the dockerhub registry - docker run -d -p 7072:7072 -v ~:/root bananocoin/banano
.
or
b) Building the image from source.
The following commands should build a banano docker image from source:
git clone https://github.com/BananoCoin/banano
cd banano/docker
node/build.sh live # choose a network - live, beta or test
Banano uses distinct ports from Nano, and RPC is enabled by default.
docker run -d -p 7072:7072 -v ~:/root bananocoin/banano
where:
a) -p is proxying localhost tcp/7072 to tcp/7072 on the container.
b) -v is mounting your home directory as /root/ on the container.
After a few seconds, test the node with:
curl -d '{"action": "version"}' localhost:7072
curl -d '{"action": "block_count"}' localhost:7072
And check if peer count has went up on the official monitor.
The bananode process rolls logs, and they are not piped to the containers stdout. This means they are not available to view via docker log
. To examine the nodes logs e.g.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5368f4c7fe63 bananocoin/banano:v18 "/bin/bash /entry.sh" 44 minutes ago Up 44 minutes 0.0.0.0:7072->7072/tcp elated_jennings
$ docker exec -it 5368f4c7fe63 bash
root@5368f4c7fe63:/# cd /root/BananoData/log/
root@5368f4c7fe63:~/BananoData/log# ll
total 56
drwx------ 2 root root 4096 Mar 22 20:33 ./
drwx------ 3 root root 4096 Mar 22 20:20 ../
-rw------- 1 root root 9715 Mar 22 20:32 log_2019-03-22_20-20-29.0.log
-rw------- 1 root root 31711 Mar 22 21:18 log_2019-03-22_20-33-50.1.log
root@5368f4c7fe63:~/BananoData/log#