toxcore/other/bootstrap_daemon/docker/Dockerfile
romik-g c2b2142f33 Changes from @nurupo for build and runtime dependencies that reduce image size
Also removal of example bootstrap nodes from the config file in one line
2016-03-03 13:30:11 -05:00

59 lines
1.7 KiB
Docker

FROM debian:jessie
WORKDIR /tmp/tox
RUN export BUILD_PACKAGES="\
build-essential \
libtool \
autotools-dev \
automake \
checkinstall \
check \
git \
yasm \
libsodium-dev \
libconfig-dev \
python3" && \
export RUNTIME_PACKAGES="\
libconfig9 \
libsodium13" && \
# get all deps
apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \
# install toxcore and daemon
git clone https://github.com/irungentoo/toxcore && \
cd toxcore && \
./autogen.sh && \
./configure --enable-daemon && \
make -j`nproc` && \
make install -j`nproc` && \
ldconfig && \
# add new user
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 && \
chmod 700 /var/lib/tox-bootstrapd && \
cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \
# remove all the example bootstrap nodes from the config file
sed -i '/^bootstrap_nodes = /,$d' /etc/tox-bootstrapd.conf && \
# add bootstrap nodes from https://nodes.tox.chat/
python3 other/bootstrap_daemon/docker/get-nodes.py >> /etc/tox-bootstrapd.conf && \
# perform cleanup
export AUTO_ADDED_PACKAGES="$(apt-mark showauto)" && \
apt-get remove --purge -y $BUILD_PACKAGES $AUTO_ADDED_PACKAGES && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
cd / && \
rm -rf /tmp/*
WORKDIR /var/lib/tox-bootstrapd
USER tox-bootstrapd
ENTRYPOINT /usr/local/bin/tox-bootstrapd \
--config /etc/tox-bootstrapd.conf \
--log-backend stdout \
--foreground
EXPOSE 443/tcp 3389/tcp 33445/tcp 33445/udp