diff options
author | irungentoo <irungentoo@gmail.com> | 2016-03-07 14:57:51 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2016-03-07 14:57:51 -0500 |
commit | 2e48a3f51d81e9b4208281f685ae8722ba7cb155 (patch) | |
tree | 3af9f3de0ffe0892a1dee8c20ebb04b68801c67b /other/bootstrap_daemon/docker/Dockerfile | |
parent | c817b3334f0b1a134c1114d5a5c5f226631df136 (diff) | |
parent | c2b2142f336640e35c27fd5fdbe8348ddcff16b5 (diff) |
Merge branch 'tox-bootstrapd-smaller-docker' of https://github.com/nurupo/InsertProjectNameHere
Diffstat (limited to 'other/bootstrap_daemon/docker/Dockerfile')
-rw-r--r-- | other/bootstrap_daemon/docker/Dockerfile | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile index ef9d525c..d4d611b5 100644 --- a/other/bootstrap_daemon/docker/Dockerfile +++ b/other/bootstrap_daemon/docker/Dockerfile | |||
@@ -1,7 +1,8 @@ | |||
1 | FROM debian:jessie | 1 | FROM debian:jessie |
2 | 2 | ||
3 | # get all deps | 3 | WORKDIR /tmp/tox |
4 | RUN apt-get update && apt-get install -y \ | 4 | |
5 | RUN export BUILD_PACKAGES="\ | ||
5 | build-essential \ | 6 | build-essential \ |
6 | libtool \ | 7 | libtool \ |
7 | autotools-dev \ | 8 | autotools-dev \ |
@@ -12,41 +13,40 @@ RUN apt-get update && apt-get install -y \ | |||
12 | yasm \ | 13 | yasm \ |
13 | libsodium-dev \ | 14 | libsodium-dev \ |
14 | libconfig-dev \ | 15 | libconfig-dev \ |
15 | python3 \ | 16 | python3" && \ |
16 | && apt-get clean \ | 17 | export RUNTIME_PACKAGES="\ |
17 | && rm -rf /var/lib/apt/lists/* | 18 | libconfig9 \ |
18 | 19 | libsodium13" && \ | |
20 | # get all deps | ||
21 | apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \ | ||
19 | # install toxcore and daemon | 22 | # install toxcore and daemon |
20 | WORKDIR /root/ | 23 | git clone https://github.com/irungentoo/toxcore && \ |
21 | RUN git clone https://github.com/irungentoo/toxcore | 24 | cd toxcore && \ |
22 | WORKDIR /root/toxcore/ | 25 | ./autogen.sh && \ |
23 | RUN ./autogen.sh | 26 | ./configure --enable-daemon && \ |
24 | RUN ./configure --enable-daemon | 27 | make -j`nproc` && \ |
25 | RUN make -j`nproc` | 28 | make install -j`nproc` && \ |
26 | RUN make install -j`nproc` | 29 | ldconfig && \ |
27 | RUN ldconfig | ||
28 | |||
29 | WORKDIR /root/toxcore/other/bootstrap_daemon/ | ||
30 | |||
31 | # add new user | 30 | # add new user |
32 | RUN useradd --home-dir /var/lib/tox-bootstrapd --create-home \ | 31 | useradd --home-dir /var/lib/tox-bootstrapd --create-home \ |
33 | --system --shell /sbin/nologin \ | 32 | --system --shell /sbin/nologin \ |
34 | --comment "Account to run Tox's DHT bootstrap daemon" \ | 33 | --comment "Account to run Tox's DHT bootstrap daemon" \ |
35 | --user-group tox-bootstrapd | 34 | --user-group tox-bootstrapd && \ |
36 | RUN chmod 700 /var/lib/tox-bootstrapd | 35 | chmod 700 /var/lib/tox-bootstrapd && \ |
37 | 36 | cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \ | |
38 | RUN cp tox-bootstrapd.conf /etc/tox-bootstrapd.conf | ||
39 | |||
40 | # remove all the example bootstrap nodes from the config file | 37 | # remove all the example bootstrap nodes from the config file |
41 | RUN N=-1 && \ | 38 | sed -i '/^bootstrap_nodes = /,$d' /etc/tox-bootstrapd.conf && \ |
42 | while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \ | ||
43 | do \ | ||
44 | head -n $N tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \ | ||
45 | N=$((N-1)); \ | ||
46 | done | ||
47 | |||
48 | # add bootstrap nodes from https://nodes.tox.chat/ | 39 | # add bootstrap nodes from https://nodes.tox.chat/ |
49 | RUN python3 docker/get-nodes.py >> /etc/tox-bootstrapd.conf | 40 | python3 other/bootstrap_daemon/docker/get-nodes.py >> /etc/tox-bootstrapd.conf && \ |
41 | # perform cleanup | ||
42 | export AUTO_ADDED_PACKAGES="$(apt-mark showauto)" && \ | ||
43 | apt-get remove --purge -y $BUILD_PACKAGES $AUTO_ADDED_PACKAGES && \ | ||
44 | apt-get clean && \ | ||
45 | rm -rf /var/lib/apt/lists/* && \ | ||
46 | cd / && \ | ||
47 | rm -rf /tmp/* | ||
48 | |||
49 | WORKDIR /var/lib/tox-bootstrapd | ||
50 | 50 | ||
51 | USER tox-bootstrapd | 51 | USER tox-bootstrapd |
52 | 52 | ||
@@ -55,5 +55,4 @@ ENTRYPOINT /usr/local/bin/tox-bootstrapd \ | |||
55 | --log-backend stdout \ | 55 | --log-backend stdout \ |
56 | --foreground | 56 | --foreground |
57 | 57 | ||
58 | EXPOSE 443 3389 33445 | 58 | EXPOSE 443/tcp 3389/tcp 33445/tcp 33445/udp |
59 | EXPOSE 33445/udp | ||