summaryrefslogtreecommitdiff
path: root/other/bootstrap_daemon/docker
diff options
context:
space:
mode:
Diffstat (limited to 'other/bootstrap_daemon/docker')
-rw-r--r--other/bootstrap_daemon/docker/Dockerfile60
1 files changed, 32 insertions, 28 deletions
diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile
index ef9d525c..bfa8f1e1 100644
--- a/other/bootstrap_daemon/docker/Dockerfile
+++ b/other/bootstrap_daemon/docker/Dockerfile
@@ -1,7 +1,8 @@
1FROM debian:jessie 1FROM debian:jessie
2 2
3# get all deps 3WORKDIR /tmp/tox
4RUN apt-get update && apt-get install -y \ 4
5RUN export BUILD_PACKAGES="\
5 build-essential \ 6 build-essential \
6 libtool \ 7 libtool \
7 autotools-dev \ 8 autotools-dev \
@@ -11,42 +12,45 @@ RUN apt-get update && apt-get install -y \
11 git \ 12 git \
12 yasm \ 13 yasm \
13 libsodium-dev \ 14 libsodium-dev \
15 python3" && \
16 export RUNTIME_PACKAGES="\
14 libconfig-dev \ 17 libconfig-dev \
15 python3 \ 18 libsodium13" && \
16 && apt-get clean \ 19# get all deps
17 && rm -rf /var/lib/apt/lists/* 20 apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \
18
19# install toxcore and daemon 21# install toxcore and daemon
20WORKDIR /root/ 22 git clone https://github.com/irungentoo/toxcore && \
21RUN git clone https://github.com/irungentoo/toxcore 23 cd toxcore && \
22WORKDIR /root/toxcore/ 24 ./autogen.sh && \
23RUN ./autogen.sh 25 ./configure --enable-daemon && \
24RUN ./configure --enable-daemon 26 make -j`nproc` && \
25RUN make -j`nproc` 27 make install -j`nproc` && \
26RUN make install -j`nproc` 28 ldconfig && \
27RUN ldconfig
28
29WORKDIR /root/toxcore/other/bootstrap_daemon/
30
31# add new user 29# add new user
32RUN useradd --home-dir /var/lib/tox-bootstrapd --create-home \ 30 useradd --home-dir /var/lib/tox-bootstrapd --create-home \
33 --system --shell /sbin/nologin \ 31 --system --shell /sbin/nologin \
34 --comment "Account to run Tox's DHT bootstrap daemon" \ 32 --comment "Account to run Tox's DHT bootstrap daemon" \
35 --user-group tox-bootstrapd 33 --user-group tox-bootstrapd && \
36RUN chmod 700 /var/lib/tox-bootstrapd 34 chmod 700 /var/lib/tox-bootstrapd && \
37 35 cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \
38RUN cp tox-bootstrapd.conf /etc/tox-bootstrapd.conf
39
40# remove all the example bootstrap nodes from the config file 36# remove all the example bootstrap nodes from the config file
41RUN N=-1 && \ 37 N=-1 && \
42 while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \ 38 while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \
43 do \ 39 do \
44 head -n $N tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \ 40 head -n $N other/bootstrap_daemon/tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \
45 N=$((N-1)); \ 41 N=$((N-1)); \
46 done 42 done && \
47
48# add bootstrap nodes from https://nodes.tox.chat/ 43# add bootstrap nodes from https://nodes.tox.chat/
49RUN python3 docker/get-nodes.py >> /etc/tox-bootstrapd.conf 44 python3 other/bootstrap_daemon/docker/get-nodes.py >> /etc/tox-bootstrapd.conf && \
45 export AUTO_ADDED_PACKAGES="$(apt-mark showauto)" && \
46 apt-get remove --purge -y $BUILD_PACKAGES $AUTO_ADDED_PACKAGES && \
47 apt-get install -y $RUNTIME_PACKAGES && \
48 apt-get clean && \
49 rm -rf /var/lib/apt/lists/* && \
50 cd / && \
51 rm -rf /tmp/*
52
53WORKDIR /
50 54
51USER tox-bootstrapd 55USER tox-bootstrapd
52 56