diff --git a/Dockerfile b/Dockerfile index 71e17ef..5654890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,19 @@ -FROM linuxserver/baseimage -MAINTAINER lonix -ENV APTLIST="syncthing" +FROM lsiobase/alpine +MAINTAINER sparklyballs -#Applying stuff -RUN curl -s https://syncthing.net/release-key.txt | apt-key add - && \ -echo deb http://apt.syncthing.net/ syncthing release | tee /etc/apt/sources.list.d/syncthing-release.list && \ -apt-get update -q && \ -apt-get install -qy $APTLIST && \ +# environment settings +ENV HOME="/config" -# give abc home folder of /config -usermod -d /config abc && \ +# install packages +RUN \ + apk add --no-cache \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ + syncthing \ + syncthing-utils -# clean up -apt-get clean && \ -rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* +# add local files +COPY root/ / -#Adding Custom files -ADD services/ /etc/service/ -RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh - -# Volumes and Ports -VOLUME ["/config", "/sync"] -EXPOSE 8384 22000 21027/UDP \ No newline at end of file +# ports and volumes +EXPOSE 8384 22000 21027/UDP +VOLUME /config /sync diff --git a/README.md b/README.md index cee7095..1fe5a05 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring auto-update on startup, easy user mapping and community support. Find us for support at: * [forum.linuxserver.io](https://forum.linuxserver.io) * [IRC](https://www.linuxserver.io/index.php/irc/) on freenode at `#linuxserver.io` +* [Podcast](https://www.linuxserver.io/index.php/category/podcast/) covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation! # linuxserver/syncthing @@ -34,14 +35,18 @@ docker create \ * `-p 22000` Listening Port * `-p 21027/udp` Discovery Port +It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it syncthing /bin/bash`. + ### User / Group Identifiers -Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" TM. +Sometimes when using data volumes (`-v` flags) permissions issues can arise between the host OS and the container. We avoid this issue by allowing you to specify the user `PUID` and group `PGID`. Ensure the data volume directory on the host is owned by the same user you specify and it will "just work" ™. -In this instance `PUID=1001` and `PGID=1001`. To find yours use `genent passwd` as below: +In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as below: - getent passwd | grep dockeruser - dockeruser:x:1001:1001:,,,:/home/dockeruser +``` + $ id + uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup) +``` ## Setting up the application @@ -49,13 +54,13 @@ You can find some of the best documentation available on the web at [docs.syncth **Note: ** The Syncthing devs highly suggest setting a password for this container as it listens on 0.0.0.0. To do this go to `Actions -> Settings -> set user\password` for the webUI. -## Misc +## Info * Shell access whilst the container is running: `docker exec -it syncthing /bin/bash` -* Upgrade to the latest version: `docker restart syncthing` * To monitor the logs of the container in realtime: `docker logs -f syncthing` ## Versions -+ **18.12.2015:** Initial testing / release (IronicBadger) -+ **24.09.2015:** Inital dev complete (Lonix) ++ **11.08.16:** Rebase to alpine linux. ++ **18.12.15:** Initial testing / release (IronicBadger) ++ **24.09.15:** Inital dev complete (Lonix) diff --git a/root/etc/services.d/syncthing/run b/root/etc/services.d/syncthing/run new file mode 100644 index 0000000..74da193 --- /dev/null +++ b/root/etc/services.d/syncthing/run @@ -0,0 +1,8 @@ +#!/usr/bin/with-contenv bash + +umask 0000 + +exec \ + s6-setuidgid abc syncthing \ + -home=/config -no-browser -no-restart \ + --gui-address="0.0.0.0:8384" diff --git a/services/syncthing/run b/services/syncthing/run deleted file mode 100644 index 7e864f1..0000000 --- a/services/syncthing/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -umask 0000 - -exec /sbin/setuser abc syncthing -home=/config -no-browser -no-restart --gui-address="0.0.0.0:8384" \ No newline at end of file