Skip to content

Commit 739975d

Browse files
gorshunovrnurupo
authored andcommitted
Re-format to reduce image file by 50%
1 parent c510e24 commit 739975d

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

other/bootstrap_daemon/docker/Dockerfile

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM debian:jessie
22

3-
# get all deps
4-
RUN apt-get update && apt-get install -y \
3+
WORKDIR /tmp/tox
4+
5+
RUN export BUILD_PACKAGES="\
56
build-essential \
67
libtool \
78
autotools-dev \
@@ -11,42 +12,45 @@ RUN apt-get update && apt-get install -y \
1112
git \
1213
yasm \
1314
libsodium-dev \
15+
python3" && \
16+
export RUNTIME_PACKAGES="\
1417
libconfig-dev \
15-
python3 \
16-
&& apt-get clean \
17-
&& rm -rf /var/lib/apt/lists/*
18-
18+
libsodium13" && \
19+
# get all deps
20+
apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \
1921
# install toxcore and daemon
20-
WORKDIR /root/
21-
RUN git clone https://github.com/irungentoo/toxcore
22-
WORKDIR /root/toxcore/
23-
RUN ./autogen.sh
24-
RUN ./configure --enable-daemon
25-
RUN make -j`nproc`
26-
RUN make install -j`nproc`
27-
RUN ldconfig
28-
29-
WORKDIR /root/toxcore/other/bootstrap_daemon/
30-
22+
git clone https://github.com/irungentoo/toxcore && \
23+
cd toxcore && \
24+
./autogen.sh && \
25+
./configure --enable-daemon && \
26+
make -j`nproc` && \
27+
make install -j`nproc` && \
28+
ldconfig && \
3129
# add new user
32-
RUN useradd --home-dir /var/lib/tox-bootstrapd --create-home \
30+
useradd --home-dir /var/lib/tox-bootstrapd --create-home \
3331
--system --shell /sbin/nologin \
3432
--comment "Account to run Tox's DHT bootstrap daemon" \
35-
--user-group tox-bootstrapd
36-
RUN chmod 700 /var/lib/tox-bootstrapd
37-
38-
RUN cp tox-bootstrapd.conf /etc/tox-bootstrapd.conf
39-
33+
--user-group tox-bootstrapd && \
34+
chmod 700 /var/lib/tox-bootstrapd && \
35+
cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \
4036
# remove all the example bootstrap nodes from the config file
41-
RUN N=-1 && \
37+
N=-1 && \
4238
while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \
4339
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; \
4541
N=$((N-1)); \
46-
done
47-
42+
done && \
4843
# add bootstrap nodes from https://nodes.tox.chat/
49-
RUN 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+
53+
WORKDIR /
5054

5155
USER tox-bootstrapd
5256

0 commit comments

Comments
 (0)