|
| 1 | + |
| 2 | + |
| 3 | +# SYNCTHING |
| 4 | +[<img src="https://img.shields.io/github/issues/11notes/docker-SYNCTHING?color=7842f5">](https://github.com/11notes/docker-SYNCTHING/issues) |
| 5 | + |
| 6 | +Run syncthing rootless and distroless. |
| 7 | + |
| 8 | +# INTRODUCTION 📢 |
| 9 | + |
| 10 | +Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +# SYNOPSIS 📖 |
| 15 | +**What can I do with this?** This image will run syncthing [rootless](https://github.com/11notes/RTFM/blob/main/linux/container/image/rootless.md) and [distroless](https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md), for maximum security and performance. If no configuration is found this image will automatically generate a new one with the environment variables used. This image will also by default disable telemetry. |
| 16 | + |
| 17 | +# UNIQUE VALUE PROPOSITION 💶 |
| 18 | +**Why should I run this image and not the other image(s) that already exist?** Good question! Because ... |
| 19 | + |
| 20 | +> [!IMPORTANT] |
| 21 | +>* ... this image runs [rootless](https://github.com/11notes/RTFM/blob/main/linux/container/image/rootless.md) as 1000:1000 |
| 22 | +>* ... this image has no shell since it is [distroless](https://github.com/11notes/RTFM/blob/main/linux/container/image/distroless.md) |
| 23 | +>* ... this image is auto updated to the latest version via CI/CD |
| 24 | +>* ... this image has a health check |
| 25 | +>* ... this image runs read-only |
| 26 | +>* ... this image is automatically scanned for CVEs before and after publishing |
| 27 | +>* ... this image is created via a secure and pinned CI/CD process |
| 28 | +>* ... this image is very small |
| 29 | +>* ... this image has a custom init process for more comfort |
| 30 | +
|
| 31 | +If you value security, simplicity and optimizations to the extreme, then this image might be for you. |
| 32 | + |
| 33 | +# COMPARISON 🏁 |
| 34 | +Below you find a comparison between this image and the most used or original one. |
| 35 | + |
| 36 | +| **image** | 11notes/syncthing:1.30.0 | linuxserver/syncthing | |
| 37 | +| ---: | :---: | :---: | |
| 38 | +| **image size on disk** | 11.8MB | 52.7MB | |
| 39 | +| **process UID/GID** | 1000/1000 | 0/0 | |
| 40 | +| **distroless?** | ✅ | ❌ | |
| 41 | +| **rootless?** | ✅ | ❌ | |
| 42 | + |
| 43 | + |
| 44 | +# VOLUMES 📁 |
| 45 | +* **/syncthing/etc** - Directory of the configuration file |
| 46 | +* **/syncthing/var** - Directory of database and index data |
| 47 | +* **/syncthing/share** - Directory of the default share (can be used as mount point for multiple shares) |
| 48 | + |
| 49 | +# COMPOSE ✂️ |
| 50 | +```yaml |
| 51 | +name: "syncthing" |
| 52 | +services: |
| 53 | + server: |
| 54 | + image: "11notes/syncthing:1.30.0" |
| 55 | + read_only: true |
| 56 | + environment: |
| 57 | + TZ: "Europe/Zurich" |
| 58 | + SYNCTHING_PASSWORD: "${SYNCTHING_PASSWORD}" |
| 59 | + SYNCTHING_API_KEY: "${SYNCTHING_API_KEY}" |
| 60 | + volumes: |
| 61 | + - "syncthing.etc:/syncthing/etc" |
| 62 | + - "syncthing.var:/syncthing/var" |
| 63 | + - "syncthing.share:/syncthing/share" |
| 64 | + ports: |
| 65 | + - "3000:3000/tcp" |
| 66 | + - "22000:22000/tcp" |
| 67 | + - "22000:22000/udp" |
| 68 | + - "21027:21027/udp" |
| 69 | + networks: |
| 70 | + frontend: |
| 71 | + restart: "always" |
| 72 | + |
| 73 | +volumes: |
| 74 | + syncthing.etc: |
| 75 | + syncthing.var: |
| 76 | + syncthing.share: |
| 77 | + |
| 78 | +networks: |
| 79 | + frontend: |
| 80 | +``` |
| 81 | +
|
| 82 | +# DEFAULT SETTINGS 🗃️ |
| 83 | +| Parameter | Value | Description | |
| 84 | +| --- | --- | --- | |
| 85 | +| `user` | docker | user name | |
| 86 | +| `uid` | 1000 | [user identifier](https://en.wikipedia.org/wiki/User_identifier) | |
| 87 | +| `gid` | 1000 | [group identifier](https://en.wikipedia.org/wiki/Group_identifier) | |
| 88 | +| `home` | /syncthing | home directory of user docker | |
| 89 | +| `username` | admin | username | |
| 90 | + |
| 91 | +# ENVIRONMENT 📝 |
| 92 | +| Parameter | Value | Default | |
| 93 | +| --- | --- | --- | |
| 94 | +| `TZ` | [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | | |
| 95 | +| `DEBUG` | Will activate debug option for container image and app (if available) | | |
| 96 | +| `SYNCTHING_PASSWORD` | Password for the admin user, **must** be set! | | |
| 97 | +| `SYNCTHING_API_KEY` | API key, **must** be set and 32 characters long! | | |
| 98 | + |
| 99 | +# MAIN TAGS 🏷️ |
| 100 | +These are the main tags for the image. There is also a tag for each commit and its shorthand sha256 value. |
| 101 | + |
| 102 | +* [1.30.0](https://hub.docker.com/r/11notes/syncthing/tags?name=1.30.0) |
| 103 | + |
| 104 | +### There is no latest tag, what am I supposed to do about updates? |
| 105 | +It is of my opinion that the ```:latest``` tag is dangerous. Many times, I’ve introduced **breaking** changes to my images. This would have messed up everything for some people. If you don’t want to change the tag to the latest [semver](https://semver.org/), simply use the short versions of [semver](https://semver.org/). Instead of using ```:1.30.0``` you can use ```:1``` or ```:1.30```. Since on each new version these tags are updated to the latest version of the software, using them is identical to using ```:latest``` but at least fixed to a major or minor version. |
| 106 | + |
| 107 | +If you still insist on having the bleeding edge release of this app, simply use the ```:rolling``` tag, but be warned! You will get the latest version of the app instantly, regardless of breaking changes or security issues or what so ever. You do this at your own risk! |
| 108 | + |
| 109 | +# REGISTRIES ☁️ |
| 110 | +``` |
| 111 | +docker pull 11notes/syncthing:1.30.0 |
| 112 | +docker pull ghcr.io/11notes/syncthing:1.30.0 |
| 113 | +docker pull quay.io/11notes/syncthing:1.30.0 |
| 114 | +``` |
| 115 | +
|
| 116 | +# SOURCE 💾 |
| 117 | +* [11notes/syncthing](https://github.com/11notes/docker-SYNCTHING) |
| 118 | +
|
| 119 | +# PARENT IMAGE 🏛️ |
| 120 | +> [!IMPORTANT] |
| 121 | +>This image is not based on another image but uses [scratch](https://hub.docker.com/_/scratch) as the starting layer. |
| 122 | +>The image consists of the following distroless layers that were added: |
| 123 | +>* [11notes/distroless](https://github.com/11notes/docker-distroless/blob/master/arch.dockerfile) - contains users, timezones and Root CA certificates |
| 124 | +>* [11notes/distroless:localhealth](https://github.com/11notes/docker-distroless/blob/master/localhealth.dockerfile) - app to execute HTTP requests only on 127.0.0.1 |
| 125 | +
|
| 126 | +# BUILT WITH 🧰 |
| 127 | +* [syncthing](https://github.com/syncthing/syncthing) |
| 128 | +
|
| 129 | +# GENERAL TIPS 📌 |
| 130 | +> [!TIP] |
| 131 | +>* Use a reverse proxy like Traefik, Nginx, HAproxy to terminate TLS and to protect your endpoints |
| 132 | +>* Use Let’s Encrypt DNS-01 challenge to obtain valid SSL certificates for your services |
| 133 | +
|
| 134 | +# ElevenNotes™️ |
| 135 | +This image is provided to you at your own risk. Always make backups before updating an image to a different version. Check the [releases](https://github.com/11notes/docker-syncthing/releases) for breaking changes. If you have any problems with using this image simply raise an [issue](https://github.com/11notes/docker-syncthing/issues), thanks. If you have a question or inputs please create a new [discussion](https://github.com/11notes/docker-syncthing/discussions) instead of an issue. You can find all my other repositories on [github](https://github.com/11notes?tab=repositories). |
| 136 | +
|
| 137 | +*created 06.08.2025, 22:10:14 (CET)* |
0 commit comments