Public | Automated Build

Last pushed: 3 months ago
Short Description
Small, lightweight syncthing container based on Alpine Linux
Full Description

Small, lightweight Alpine based Syncthing container.

https://www.alpinelinux.org/
http://syncthing.net

This image contains a recent release of Syncthing pulled from Github. It includes the ability to automatically update within the Syncthing itself.

Alpine utilises musl instead of glibc, this causes an issue with the automatic updating of Syncthing since the update simply pulls the latest compiled version from Github which references glibc libraries.
The Dockerfile pulls in an unofficial glibc Alpine package, located here.
The Syncthing binary is then simply pulled from a Github release, with automatic updating available.

Container User Permissions

The container will run as the user with uid 1000.
Ensure a local user is available on the host with this uid, and that the /config mapped volume is read/writable by this user.

TODO: Update image to allow user defined UID/GID passed through an environment variable.

Volume Mapping

Mount any desired folders using -v <host_dir>:<docker_dir> when running the container. You can include as many volume mappings as necessary.

Usage

If running behind a NAT router, ensure port 22000 is open and forwarded to the docker host.
If this is not possible, the docker may be started with --net=host to the docker run line, which will allow uPnP to open the ports in the router. However, be aware of the implications of this detailed here.

Run with:

docker run -d --name=syncthing \
  --restart=on-failure:20 \
  -v /opt/appdata/syncthing:/config \
  -v /<host sync folder>:/sync/<sync folder> \
  -p 8384:8384/tcp \
  -p 22000:22000/tcp \
  -p 21025:21025/udp \
  gbrks/syncthing

On an upgrade, Syncthing will exit, and the container will stop. The --restart parameter below will restart the container on these events.

Sync folder

On initial run, prior to a config file being created, a default share will be established at /home/syncthing/Sync
This should be removed, as it will be internal to the container. Any sync'ed folders should be located in /sync/

Docker Pull Command
Owner
gbrks
Source Repository

Comments (1)
chamunks
2 years ago

Issues with edge

With your example for Edge it fails and loops.

[start] 19:02:57 INFO: Generating RSA key and certificate for syncthing...
[start] 19:02:58 FATAL: save cert: open /config/cert.pem: permission denied
19:03:00 WARNING: chmod /config: operation not permitted
[start] 19:03:00 INFO: Generating RSA key and certificate for syncthing...
[start] 19:03:02 FATAL: save cert: open /config/cert.pem: permission denied
19:03:05 WARNING: chmod /config: operation not permitted
[start] 19:03:05 INFO: Generating RSA key and certificate for syncthing...
[start] 19:03:07 FATAL: save cert: open /config/cert.pem: permission denied

My config

docker run -d --name=syncthing \
  --restart=on-failure:20 \
  -v ./appdata/syncthing:/config \
  -v ./data/:/sync/data/ \
  -p 8384:8384/tcp \
  -p 22000:22000/tcp \
  -p 21025:21025/udp \
  gbrks/syncthing:edge