Skip to content
This repository was archived by the owner on Feb 19, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Dockerfile
#
# @author [email protected]
# @since 2016-01
#
#
FROM phusion/baseimage:0.9.16
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without debating the relative merrits of phusion's base images, I can say for sure the relay network stuff should work fine on the regular base images, and in the interest of reducing trust and resource requirements, I'd prefer if you used the docker-provided images.

MAINTAINER PanZhibiao <[email protected]>

ENV HOME /root
ENV TERM xterm
CMD ["/sbin/my_init"]

# install packages
RUN apt-get update
RUN apt-get install -y git build-essential yasm

# build
RUN cd /root \
&& git clone https://github.com/TheBlueMatt/RelayNode.git \
&& cd RelayNode/c++ \
&& make

# daemons
RUN mkdir /etc/service/relaynode
ADD run /etc/service/relaynode/run
RUN chmod +x /etc/service/relaynode/run
40 changes: 40 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Docker for RelayNode
=======================
* base on: https://github.com/phusion/baseimage-docker
* ubuntu 14.04 LTS
* mark sure bitcoind's host & port is current in file `run`
* `BITCOIND_HOST` is bitcoind's lan/wan ip, do NOT use `127.0.0.1`
* `BITCOIND_PORT` is default `8333`

**install docker**

```
wget -qO- https://get.docker.com/ | sh
service docker start
service docker status
```

**build image**

```
# supposed Dockerfile path: /root/RelayNode/docker/Dockerfile
cd /root/RelayNode/docker

# before build, please modify `BITCOIND_HOST` in `run`
docker build -t relaynode:0.1 .
```

**start**

```
docker run -it --name relaynode --restart always -d relaynode:0.1
```

**exec docker**

```
docker exec -it relaynode /bin/bash

# eg. watch logs in docker
less /var/log/relaynode.log
```
7 changes: 7 additions & 0 deletions docker/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

EXEC=/root/RelayNode/c++/relaynetworkclient
BITCOIND_HOST=192.168.1.1
BITCOIND_PORT=8333

$EXEC $BITCOIND_HOST $BITCOIND_PORT >> /var/log/relaynode.log 2>&1