11FROM docker.io/debian:bookworm-slim as resources
2- ENV DEBIAN_FRONTEND=noninteractive
2+ ENV DEBIAN_FRONTEND=noninteractive TERM=xterm-256color
33
44RUN apt-get update && apt-get install --no-install-recommends -y \
55 wget tar ca-certificates sed
@@ -8,40 +8,29 @@ RUN wget https://www.eti-lan.xyz/sync_server.tar \
88 && mkdir /sync_server \
99 && tar xvf sync_server.tar -C /sync_server
1010
11- # Patch a permission change for /lan
12- RUN sed -i '/start() {/a chmod -R 0777 /lan; ls -al /lan ' /sync_server/etc/init.d/eti
11+ # Fix sync folder path
12+ RUN sed -i 's|/lan/|/$sync_dir/| ' /sync_server/etc/init.d/eti
1313
14+ # Patch resilio sync out of the init script
15+ RUN sed -i '/resilio-sync/s/^/#/' /sync_server/etc/init.d/eti
16+
17+ # Patch iptables sync out of the init script
18+ # Firewalling should be handled by the host
19+ RUN sed -i '/iptables/s/^/#/' /sync_server/etc/init.d/eti \
20+ && sed -i '/ip6tables/s/^/#/' /sync_server/etc/init.d/eti
21+
22+ # Set the terminal width to a fixed value to avoid issues with the init script
23+ RUN sed -i 's/terminal_width=$(tput cols)/terminal_width=100/' /sync_server/etc/init.d/eti \
24+ && sed -i '/clear/s/^/#/' /sync_server/etc/init.d/eti
1425
1526FROM docker.io/debian:bookworm-slim as running
16- ENV DEBIAN_FRONTEND=noninteractive
27+ ENV DEBIAN_FRONTEND=noninteractive TERM=xterm-256color
1728
18- RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg ca-certificates systemd systemd-sysv iproute2 procps \
29+ RUN apt-get update && apt-get install --no-install-recommends -y curl sqlite3 \
1930 && apt-get clean \
2031 && rm -rf /var/lib/apt/lists/*
2132
22- RUN echo "deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free" > /etc/apt/sources.list.d/resilio-sync.list \
23- && wget -qO - http://linux-packages.resilio.com/resilio-sync/key.asc | apt-key add - \
24- && wget -O resilio-sync.deb https://download-cdn.resilio.com/2.7.3.1381/Debian/resilio-sync_2.7.3.1381-1_amd64.deb \
25- && apt-get update \
26- && apt-get install --no-install-recommends -y net-tools curl sqlite3 iptables iptables-persistent \
27- && dpkg -i resilio-sync.deb \
28- && apt-mark hold resilio-sync \
29- && apt-get clean \
30- && rm -rf /var/lib/apt/lists/* \
31- && rm -f resilio-sync.deb
32-
3333COPY --from=resources /sync_server /
3434
35- RUN echo "alias eti='/etc/init.d/eti'" >> /root/.bashrc \
36- && update-rc.d eti defaults \
37- && update-rc.d -f resilio-sync remove \
38- && chmod +x /etc/rc.local \
39- && echo 'root:lan' | chpasswd
40-
41- RUN mkdir /lan && chmod 0777 /lan
42- VOLUME /lan
43- VOLUME /etc/iptables
44-
45- STOPSIGNAL SIGRTMIN+3
46- EXPOSE 8888
47- ENTRYPOINT ["/usr/sbin/init" ]
35+ ENTRYPOINT ["/etc/init.d/eti" ]
36+ CMD ["start" ]
0 commit comments