From 1192fe4ee10bee3d4b1514364b9f0fcba565d078 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sat, 2 Jul 2016 00:37:13 +0100 Subject: [PATCH 1/6] rebase to alpine --- Dockerfile | 31 ++++++++++++------------------- README.md | 8 ++++---- root/etc/cont-init.d/30-config | 3 +++ root/etc/services.d/syncthing/run | 5 +++++ services/syncthing/run | 5 ----- 5 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 root/etc/cont-init.d/30-config create mode 100644 root/etc/services.d/syncthing/run delete mode 100644 services/syncthing/run diff --git a/Dockerfile b/Dockerfile index 71e17ef..ae7b9bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,17 @@ -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 -# 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 +# ports and volumes VOLUME ["/config", "/sync"] -EXPOSE 8384 22000 21027/UDP \ No newline at end of file +EXPOSE 8384 22000 21027/UDP diff --git a/README.md b/README.md index cee7095..c0a2412 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -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: +The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring 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` @@ -52,10 +52,10 @@ You can find some of the best documentation available on the web at [docs.syncth ## Misc * 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) ++ **02.07.16:** Rebase to alpine for smaller image size. ++ **18.12.15:** Initial testing / release (IronicBadger) ++ **24.09.15:** Inital dev complete (Lonix) diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..0fc5d46 --- /dev/null +++ b/root/etc/cont-init.d/30-config @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv sh + +chown abc:abc /sync diff --git a/root/etc/services.d/syncthing/run b/root/etc/services.d/syncthing/run new file mode 100644 index 0000000..2c15b8a --- /dev/null +++ b/root/etc/services.d/syncthing/run @@ -0,0 +1,5 @@ +#!/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 From 259b922ef0efb28d9816072101556730339b9b0e Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Sat, 2 Jul 2016 00:40:56 +0100 Subject: [PATCH 2/6] remove init perms script --- root/etc/cont-init.d/30-config | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 root/etc/cont-init.d/30-config diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config deleted file mode 100644 index 0fc5d46..0000000 --- a/root/etc/cont-init.d/30-config +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv sh - -chown abc:abc /sync From 7367e50b57dcdca05a559682c6720a81df7d5301 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Mon, 1 Aug 2016 14:28:59 +0100 Subject: [PATCH 3/6] tidying, adding syncthing-utils to install --- Dockerfile | 6 ++++-- root/etc/services.d/syncthing/run | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae7b9bc..2f27d92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,13 @@ ENV HOME="/config" # install packages RUN \ apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community \ - syncthing + syncthing \ + syncthing-utils + # add local files COPY root/ / # ports and volumes -VOLUME ["/config", "/sync"] EXPOSE 8384 22000 21027/UDP +VOLUME /config /sync diff --git a/root/etc/services.d/syncthing/run b/root/etc/services.d/syncthing/run index 2c15b8a..74da193 100644 --- a/root/etc/services.d/syncthing/run +++ b/root/etc/services.d/syncthing/run @@ -2,4 +2,7 @@ umask 0000 -exec s6-setuidgid abc syncthing -home=/config -no-browser -no-restart --gui-address="0.0.0.0:8384" +exec \ + s6-setuidgid abc syncthing \ + -home=/config -no-browser -no-restart \ + --gui-address="0.0.0.0:8384" From ad207d7a9f72ec50531d0b0a458920e0f409fff4 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Mon, 1 Aug 2016 14:33:03 +0100 Subject: [PATCH 4/6] standardise README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0a2412..237d2d9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ ![https://linuxserver.io](https://www.linuxserver.io/wp-content/uploads/2015/06/linuxserver_medium.png) -The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring easy user mapping and community support. Find us for support at: +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 @@ -36,12 +37,14 @@ docker create \ ### 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,7 +52,7 @@ 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` * To monitor the logs of the container in realtime: `docker logs -f syncthing` From 34356e19381e7340791ea938dc82f57534414a34 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Mon, 1 Aug 2016 14:35:26 +0100 Subject: [PATCH 5/6] standardise README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 237d2d9..ab24f8b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ 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" ™. From 380d2cb1cc912ee00ef96a0045ed7d22f65c8f57 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Thu, 11 Aug 2016 12:06:33 +0100 Subject: [PATCH 6/6] getting alpine rebase release-ready --- Dockerfile | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f27d92..5654890 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,11 @@ ENV HOME="/config" # install packages RUN \ - apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/community \ + apk add --no-cache \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ syncthing \ syncthing-utils - # add local files COPY root/ / diff --git a/README.md b/README.md index ab24f8b..1fe5a05 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,6 @@ You can find some of the best documentation available on the web at [docs.syncth ## Versions -+ **02.07.16:** Rebase to alpine for smaller image size. ++ **11.08.16:** Rebase to alpine linux. + **18.12.15:** Initial testing / release (IronicBadger) + **24.09.15:** Inital dev complete (Lonix)