Relaysrv Dockerfile


I hacked a small Dockerfile for relaysrv, maybe someone will be happy because of this. Here it is:

# Build:
#   docker build -t syncthing-relaysrv .
# Run:
#   docker run --name=syncthing-relaysrv -p 22067:22067 syncthing-relaysrv
#   docker run --name=syncthing-relaysrv -p 22067:22067 -e "PROVIDEDBY=stone" syncthing-relaysrv

FROM ubuntu:15.10

EXPOSE 22067

RUN apt-get update && apt-get -y install golang \

RUN useradd -s /bin/bash -m syncthing

USER syncthing
WORKDIR /home/syncthing

ENV GOPATH /home/syncthing/go
RUN go get

CMD /home/syncthing/go/bin/relaysrv --debug -provided-by "$PROVIDEDBY"



EDITED: to contain the ProvidedBy string as an option.

Cool. Note that you could make this image a lot smaller by basing it on something minimal (busybox etc) and using a precompiled binary, though.

Yes it will be smaller but, I think this way it is more educative (so the user can see what’s happening) and don’t have binary-blob, what is a more secure feeling.

1 Like