Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
FROM ubuntu:15.10
FROM ubuntu:14.04
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why downgrade ubuntu?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the common practice I've seen for ubuntu based image and ubuntu:latest does point to ubuntu:14.04 (see https://hub.docker.com/_/ubuntu/). But it's arguable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I guess it's just b/c 14.04 is the LTS release. I don't know enough about what v15 offers to ignore the stability, so makes sense to me!

MAINTAINER Joey Baker <[email protected]>

ENV SYNCTHING_VERSION 0.12.11

RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install curl ca-certificates -y --no-install-recommends \
&& 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$SYNCTHING_VERSION/syncthing-linux-amd64-v$SYNCTHING_VERSION.tar.gz \
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 \
&& mv syncthing-linux-amd64-v* syncthing \
Expand All @@ -32,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"]

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 .
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean we'll need to change the version in two files?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, maybe there is a clever way to use environment variables from the build?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm… I think so… https://docs.docker.com/engine/reference/builder/#arg should do the trick? The only problem with the makefile approach though is that the repo can't auto-deploy to docker hub on push to master. What do you think?

14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.