From d9881d89c05e15a751caf005abc43296fc453c59 Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Tue, 5 Jan 2016 18:15:14 +0100 Subject: [PATCH 1/4] Update syncthing to 0.12.11 and gosu to 1.7 --- Dockerfile | 19 ++++++++++--------- start.sh => files/start.sh | 0 2 files changed, 10 insertions(+), 9 deletions(-) rename start.sh => files/start.sh (100%) diff --git a/Dockerfile b/Dockerfile index d15852e..be3ea59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:15.10 +FROM ubuntu:14.04 MAINTAINER Joey Baker RUN apt-get update \ @@ -7,19 +7,22 @@ RUN apt-get update \ && apt-get autoremove -y \ && apt-get clean +ENV SYNCTHING_VERSION 0.12.11 +ENV SYNCTHING_USER syncthing +ENV UID 1027 + # grab gosu for easy step-down from root RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ - && curl -o /usr/local/bin/gosu.asc -L "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -L "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \ && gpg --verify /usr/local/bin/gosu.asc \ && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu # get syncthing WORKDIR /srv -RUN useradd --no-create-home -g users syncthing -RUN export version=0.12.9 \ - && curl -L -o syncthing.tar.gz https://github.com/syncthing/syncthing/releases/download/v$version/syncthing-linux-amd64-v$version.tar.gz \ +RUN useradd --no-create-home -g users --uid $SYNCTHING_UID $SYNCTHING_USER +RUN curl -L -o syncthing.tar.gz https://github.com/syncthing/syncthing/releases/download/v$SYNCTHING_VERSION/syncthing-linux-amd64-v$SYNCTHING_VERSION.tar.gz \ && tar -xzvf syncthing.tar.gz \ && rm -f syncthing.tar.gz \ && mv syncthing-linux-amd64-v* syncthing \ @@ -30,10 +33,8 @@ RUN export version=0.12.9 \ VOLUME ["/srv/data", "/srv/config"] -ADD ./start.sh /srv/start.sh +ADD ./files/start.sh /srv/start.sh RUN chmod 770 /srv/start.sh -ENV UID=1027 - ENTRYPOINT ["/srv/start.sh"] diff --git a/start.sh b/files/start.sh similarity index 100% rename from start.sh rename to files/start.sh From edd83943525eeb15d7ad9908d70ae28f5e53b5de Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Tue, 5 Jan 2016 18:15:27 +0100 Subject: [PATCH 2/4] Add Makefile --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d72d1a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +all: build + +build: + @docker build --tag=joeybaker/syncthing:latest . + +base: + @docker pull ubuntu:14.04 + +rebuild: base + @docker build --tag=joeybaker/syncthing:latest . + +release: rebuild + @docker build --tag=joeybaker/syncthing:0.12.11 . From 2c3e3294675b35b9244460d12d8c1a9d8912d487 Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Tue, 5 Jan 2016 18:15:46 +0100 Subject: [PATCH 3/4] Add docker-compose.yml --- docker-compose.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..eeb344a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +# https://docs.docker.com/compose/yml/ + +syncthing: + container_name: syncthing + hostname: syncthing + image: joeybaker/syncthing + ports: + - "22000:22000" + - "8080:8080" + - "21025:21025/udp" + volumes: + - /srv/docker/syncthing/data:/srv/data + - /srv/docker/syncthing/config:/srv/config + restart: always From 9d2ecd85d51c7f0dc196015366eba7356673c6b0 Mon Sep 17 00:00:00 2001 From: Olivier Louvignes Date: Tue, 5 Jan 2016 18:19:25 +0100 Subject: [PATCH 4/4] Proper UID --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be3ea59..f3f6616 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF35 # get syncthing WORKDIR /srv -RUN useradd --no-create-home -g users --uid $SYNCTHING_UID $SYNCTHING_USER +RUN useradd --no-create-home -g users --uid $UID $SYNCTHING_USER RUN curl -L -o syncthing.tar.gz https://github.com/syncthing/syncthing/releases/download/v$SYNCTHING_VERSION/syncthing-linux-amd64-v$SYNCTHING_VERSION.tar.gz \ && tar -xzvf syncthing.tar.gz \ && rm -f syncthing.tar.gz \