toxcore/other/bootstrap_daemon/docker/Dockerfile

64 lines
1.9 KiB
Docker
Raw Normal View History

2016-01-02 06:18:37 +08:00
FROM debian:jessie
2016-01-27 23:11:45 +08:00
WORKDIR /tmp/tox
RUN export BUILD_PACKAGES="\
2016-01-02 06:18:37 +08:00
build-essential \
libtool \
autotools-dev \
automake \
checkinstall \
check \
git \
yasm \
libsodium-dev \
2016-01-27 23:11:45 +08:00
python3" && \
export RUNTIME_PACKAGES="\
2016-01-02 06:18:37 +08:00
libconfig-dev \
2016-01-27 23:11:45 +08:00
libsodium13" && \
# get all deps
apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \
2016-01-02 06:18:37 +08:00
# install toxcore and daemon
2016-01-27 23:11:45 +08:00
git clone https://github.com/irungentoo/toxcore && \
cd toxcore && \
./autogen.sh && \
./configure --enable-daemon && \
make -j`nproc` && \
make install -j`nproc` && \
ldconfig && \
2016-01-02 06:18:37 +08:00
# add new user
2016-01-27 23:11:45 +08:00
useradd --home-dir /var/lib/tox-bootstrapd --create-home \
2016-01-02 06:18:37 +08:00
--system --shell /sbin/nologin \
--comment "Account to run Tox's DHT bootstrap daemon" \
2016-01-27 23:11:45 +08:00
--user-group tox-bootstrapd && \
chmod 700 /var/lib/tox-bootstrapd && \
cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \
2016-01-02 06:18:37 +08:00
# remove all the example bootstrap nodes from the config file
2016-01-27 23:11:45 +08:00
N=-1 && \
2016-01-02 06:18:37 +08:00
while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \
do \
2016-01-27 23:11:45 +08:00
head -n $N other/bootstrap_daemon/tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \
2016-01-02 06:18:37 +08:00
N=$((N-1)); \
2016-01-27 23:11:45 +08:00
done && \
2016-01-02 06:18:37 +08:00
# add bootstrap nodes from https://nodes.tox.chat/
2016-01-27 23:11:45 +08:00
python3 other/bootstrap_daemon/docker/get-nodes.py >> /etc/tox-bootstrapd.conf && \
export AUTO_ADDED_PACKAGES="$(apt-mark showauto)" && \
apt-get remove --purge -y $BUILD_PACKAGES $AUTO_ADDED_PACKAGES && \
apt-get install -y $RUNTIME_PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
cd / && \
rm -rf /tmp/*
WORKDIR /
2016-01-02 06:18:37 +08:00
USER tox-bootstrapd
ENTRYPOINT /usr/local/bin/tox-bootstrapd \
--config /etc/tox-bootstrapd.conf \
--log-backend stdout \
--foreground
EXPOSE 443 3389 33445
EXPOSE 33445/udp