diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2016-01-01 17:18:37 -0500 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2016-01-01 20:29:24 -0500 |
commit | 1b721ea1ec1b0bca82750e07bd475662f8cc8df0 (patch) | |
tree | 789ee8b632b423cd6d9ad098b5af9c623eba8156 /other/bootstrap_daemon/README.md | |
parent | c22c06adbe2351bcfbbd60326fc3b600206e701e (diff) |
Add Dockerfile for the daemon
Diffstat (limited to 'other/bootstrap_daemon/README.md')
-rw-r--r-- | other/bootstrap_daemon/README.md | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/other/bootstrap_daemon/README.md b/other/bootstrap_daemon/README.md index e77e3ae0..2d9e5615 100644 --- a/other/bootstrap_daemon/README.md +++ b/other/bootstrap_daemon/README.md | |||
@@ -5,7 +5,9 @@ | |||
5 | <br> | 5 | <br> |
6 | - [For `init.d` users](#initd) | 6 | - [For `init.d` users](#initd) |
7 | - [Troubleshooting](#initd-troubleshooting) | 7 | - [Troubleshooting](#initd-troubleshooting) |
8 | 8 | <br> | |
9 | - [For `Docker` users](#docker) | ||
10 | - [Troubleshooting](#docker-troubleshooting) | ||
9 | 11 | ||
10 | These instructions are primarily tested on Debian Linux, Wheezy for init.d and Jessie for systemd, but they should work on other POSIX-compliant systems too. | 12 | These instructions are primarily tested on Debian Linux, Wheezy for init.d and Jessie for systemd, but they should work on other POSIX-compliant systems too. |
11 | 13 | ||
@@ -146,3 +148,50 @@ sudo grep "tox-bootstrapd" /var/log/syslog | |||
146 | - Make sure tox-bootstrapd has read permission for the config file. | 148 | - Make sure tox-bootstrapd has read permission for the config file. |
147 | 149 | ||
148 | - Make sure tox-bootstrapd location matches its path in the `/etc/init.d/tox-bootstrapd` init script. | 150 | - Make sure tox-bootstrapd location matches its path in the `/etc/init.d/tox-bootstrapd` init script. |
151 | |||
152 | |||
153 | <a name="docker" /> | ||
154 | ##For `Docker` users: | ||
155 | |||
156 | If you are familiar with Docker and would rather run the daemon in a Docker container, run the following from this directory: | ||
157 | |||
158 | ```sh | ||
159 | sudo docker build -t tox-bootstrapd docker/ | ||
160 | |||
161 | sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd | ||
162 | sudo chmod 700 /var/lib/tox-bootstrapd | ||
163 | |||
164 | sudo docker run -d --name tox-bootstrapd --restart always -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd | ||
165 | ``` | ||
166 | |||
167 | We create a new user and protect its home directory in order to mount it in the Docker image, so that the kyepair the daemon uses would be shared with the host system, which makes it less likely that you would loose the keypair while playing with the Docker container. | ||
168 | |||
169 | You can check logs for your public key or any errors: | ||
170 | ```sh | ||
171 | sudo docker logs tox-bootstrapd | ||
172 | ``` | ||
173 | |||
174 | If you are an experienced Docker user and have a version of Docker that supports `docker cp` both host->container and container->host directions, you might want to skip the directory mounting part and just do: | ||
175 | |||
176 | ```sh | ||
177 | sudo docker build -t tox-bootstrapd docker/ | ||
178 | sudo docker run -d --name tox-bootstrapd --restart always -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd | ||
179 | sudo docker logs tox-bootstrapd | ||
180 | ``` | ||
181 | |||
182 | The keypair is stored in `/var/lib/tox-bootstrapd/keys` file, so if you skipped the directory mounting part and want a new Docker container to retain the same public key that from an old one, just copy/overwrite it from the old container. | ||
183 | |||
184 | Note that the Docker container runs a script which pulls a list of bootstrap nodes off https://nodes.tox.chat/ and adds them in the config file. | ||
185 | |||
186 | <a name="docker-troubleshooting" /> | ||
187 | ###Troubleshooting: | ||
188 | |||
189 | - Check if the container is running: | ||
190 | ```sh | ||
191 | sudo docker ps -a | ||
192 | ``` | ||
193 | |||
194 | - Check the log for errors: | ||
195 | ```sh | ||
196 | sudo docker logs tox-bootstrapd | ||
197 | ``` | ||