HUB
Sign inSign up
syncthing logo

dgcosenza/syncthing

By dgcosenza

•Updated about 12 hours ago

Hardened Debian 13 build of Syncthing from official Go source, drop-in for linuxserver/syncthing.

Image
0

2.1K

dgcosenza/syncthing repository overview

⁠Syncthing for Debian 13 (trixie-slim)

Daily CI OpenSSF Scorecard Workflow Gitleaks Secret Scan Public Content Check OpenSSF Scorecard OpenSSF Best Practices

Trivy + Grype: 0 Fixable CVEs Signed: Cosign OIDC SLSA Build L3 SBOM: SPDX + CycloneDX Base OS Architectures Healthcheck: CI Verified Renovate Enabled Dependabot Enabled Daily Rebuilds

Latest Release Release Date Last Commit Docker Pulls Docker Image Size Registries: Docker Hub + GHCR Packaging License: MIT Upstream License GitHub Issues FNX Labs Catalog

A source-built, multi-arch, continuously rebuilt Debian 13 (trixie-slim) container image of Syncthing⁠, compiled with -no-upgrade, CGO_ENABLED=0, the latest Go toolchain, and patched Go security dependencies, maintained by Daniel G. Cosenza from FNX Labs.


⁠Overview

dgcosenza/syncthing compiles official Syncthing Go source tags with refreshed security-sensitive Go modules (golang.org/x/{net,crypto,sys}) on Debian 13 (trixie-slim) for both linux/amd64 and linux/arm64:

  • Drop-in replacement for linuxserver/syncthing: Preserves /config (cert.pem, key.pem, config.xml, index-v2/), PUID/PGID, UMASK/UMASK_SET, STGUIADDRESS=0.0.0.0:8384, ports 8384/22000/21027, and /rest/noauth/health — without s6-overlay overhead, using tini and setpriv --no-new-privs.
  • Rootless & read-only rootfs ready: Verified natively on both architectures in both drop-in PUID/PGID mode and strict rootless mode (--user 1000:1000 --read-only --cap-drop ALL --security-opt no-new-privileges:true).
  • Hardened supply chain: Hadolint + Gitleaks preflight, native multi-arch smoke tests, strict Dive efficiency gate (>= 95%, <= 5% wasted), Syft SPDX + CycloneDX SBOMs, Trivy + Grype (SBOM) zero-fixable all-severity gates, Cosign keyless OIDC signatures & SBOM attestations, SLSA Build L3 provenance, dual-registry publishing, and signed GitHub Releases.

⁠Current Versions

ComponentResolved Version
Syncthingv2.1.7
Go toolchain1.27.4
Base OSDebian 13.8 (trixie-slim)
Architectureslinux/amd64, linux/arm64
Compressed size (per arch)amd64: 52.8 MB, arm64: 52.1 MB
Last verified build (UTC)2026-11-28
Published multi-arch digestdgcosenza/syncthing@sha256:6da4fa46cf4b10e76dbf3eb9e2ccc910189e2d249297631ec38baa132041577f
GHCR mirrorghcr.io/dgcosenza/syncthing@sha256:6da4fa46cf4b10e76dbf3eb9e2ccc910189e2d249297631ec38baa132041577f
Supply chainCosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance
Security gate (Trivy + Grype on SBOM)0 fixable findings of any severity (15 upstream-unfixed)

Currently tracked upstream-unfixed findings (no fix released): CVE-2025-69720, CVE-2026-107494, CVE-2026-119373, CVE-2026-119374, CVE-2026-119379, CVE-2026-12064, CVE-2026-124709, CVE-2026-16742, CVE-2026-54369, CVE-2026-76642 (+5 more in CI artifacts).


⁠Supported Tags & Tag Policy

Identical multi-arch OCI digests are published to Docker Hub (dgcosenza/syncthing) and GHCR (ghcr.io/dgcosenza/syncthing), accompanied by an automated signed GitHub Release⁠:

TagPolicyDescription
<version>-<YYYYMMDD> (e.g. 2.1.7-20261125)ImmutableDate-stamped daily rebuild pinning the Syncthing release and UTC build date.
sha-<short>ImmutablePackaging repository Git commit tag.
<version> (e.g. 2.1.7)MovingLatest verified Debian 13 + patched Go rebuild of that Syncthing release.
latestMovingLatest verified build tracking the newest official Syncthing release.

Production pinning: Pin by immutable digest:

image: dgcosenza/syncthing:2.1.7@sha256:<digest>
# or via GitHub Container Registry (identical digest):
image: ghcr.io/dgcosenza/syncthing:2.1.7@sha256:<digest>

⁠Supported Architectures

ArchitectureStatusVerification
linux/amd64Published & natively testedCompiled with latest Go trixie + patched x/* modules, smoke-tested (both drop-in and --user 1000:1000 --read-only --cap-drop ALL), Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native x86_64 CI runners.
linux/arm64Published & natively testedCompiled with latest Go trixie + patched x/* modules, smoke-tested (both drop-in and --user 1000:1000 --read-only --cap-drop ALL), Dive-gated, Syft/Trivy/Grype-scanned, and Cosign-signed on native ARM64 CI runners.

⁠Quick Start

⁠docker run (hardened, rootless, read-only)
docker run -d --name syncthing \
  --restart unless-stopped \
  --user 1000:1000 \
  --read-only \
  --cap-drop ALL \
  --security-opt no-new-privileges:true \
  --tmpfs /tmp:noexec,nosuid,size=32m \
  -e TZ=Etc/UTC \
  -e UMASK_SET=022 \
  -p 127.0.0.1:8384:8384/tcp \
  -p 22000:22000/tcp \
  -p 22000:22000/udp \
  -p 21027:21027/udp \
  -v ./config:/config \
  dgcosenza/syncthing:latest

Verify health:

curl -fsS http://127.0.0.1:8384/rest/noauth/health
⁠Hardened Docker Compose

See docker-compose.example.yml⁠ for a hardened compose example running rootless (user: "1000:1000") with read_only: true, cap_drop: [ALL], no-new-privileges:true, /tmp tmpfs, and resource limits. (When migrating a host directory with mixed ownership from linuxserver/syncthing, omit user: and cap_drop: [ALL] so the entrypoint repairs ownership and drops to PUID:PGID via setpriv.)


⁠Configuration

⁠Ports & Volumes
ResourceDetailsPurpose
8384/tcpWeb GUI / REST APIBind to loopback or a management IP (192.0.2.10) where possible
22000/tcp & 22000/udpSync protocolTCP and QUIC peer sync
21027/udpDiscoveryLocal LAN discovery broadcasts
/configPersistent volumeconfig.xml, device identity (cert.pem/key.pem), TLS keys, index-v2/
/data (optional)Persistent volumeAdditional synced folders
⁠Environment Variables
VariableDefaultDescription
PUID / PGID1000 / 1000Numeric user/group IDs Syncthing drops privileges to when started as root
UMASK / UMASK_SET022File creation mask (UMASK_SET takes precedence for linuxserver/syncthing parity)
TZUTCContainer timezone
HOME / STHOMEDIR/configSyncthing state/config directory
STGUIADDRESS0.0.0.0:8384Web GUI bind address inside the container
SKIP_CHOWN(unset)Set to 1 to skip startup ownership repair on /config

⁠Healthcheck

HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
    CMD ["sh", "-c", "curl -fsS http://127.0.0.1:8384/rest/noauth/health >/dev/null || exit 1"]

Probes /rest/noauth/health directly and fails closed when Syncthing stops.


⁠Upgrading and Migrating from linuxserver/syncthing

  1. Back up /config (config.xml, cert.pem, key.pem, https-*.pem, index-v2/) before making changes. Never share or expose key.pem or config.xml.
  2. Replace linuxserver/syncthing:latest with dgcosenza/syncthing:<version>@sha256:<digest> (or ghcr.io/dgcosenza/syncthing:<version>@sha256:<digest>).
  3. Keep your existing PUID, PGID, TZ, UMASK_SET, /config, data mounts, and port mappings.
  4. Recreate the container (docker compose up -d syncthing), confirm healthy status, and verify your Device ID and folders remain unchanged.

⁠Supply-Chain Verification

Every published digest (multi-arch index and per-architecture manifests) on both Docker Hub and GHCR is keyless-signed with Sigstore Cosign (GitHub OIDC), attested with SPDX and CycloneDX SBOMs, and backed by SLSA Build L3 provenance (actions/attest-build-provenance).

⁠Verify image signature with Cosign
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/syncthing-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/syncthing:latest

# Or against Docker Hub (identical digest):
cosign verify \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/syncthing-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  dgcosenza/syncthing:latest
⁠Verify SPDX / CycloneDX SBOM attestations
cosign verify-attestation \
  --type spdxjson \
  --certificate-identity-regexp="^https://github\.com/dgcosenza/syncthing-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
  --certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
  ghcr.io/dgcosenza/syncthing@sha256:<arch-digest>
⁠Verify SLSA Build Provenance
gh attestation verify oci://ghcr.io/dgcosenza/syncthing:latest --owner dgcosenza

⁠Security

  • Preflight gates: Every push and PR runs Hadolint (blocking on warning+), Gitleaks secret scanning across git history, and public-content/attribution/license checks.
  • Patched Go binary: Compiled daily from official upstream tags with CGO_ENABLED=0, -no-upgrade, the latest Go trixie toolchain (GOTOOLCHAIN=local), and updated golang.org/x/{net,crypto,sys} modules (eliminating binary CVEs such as CVE-2026-78661).
  • Rootless & read-only ready: Supports both setpriv --no-new-privs privilege drop and direct --user 1000:1000 --read-only --cap-drop ALL execution.
  • Vulnerability & efficiency gates (all severities with a fix): Each architecture generates Syft SPDX + CycloneDX SBOMs, passes a strict Dive efficiency gate (>= 95%, <= 5% wasted), and must pass Trivy (table, JSON, SARIF to Code Scanning, blocking --ignore-unfixed) and Grype scanning the SPDX SBOM (--only-fixed --fail-on negligible) with 0 fixable vulnerabilities of any severity.
  • Dependency automation: Renovate (renovate.json) pins base image digests and GitHub Action commit SHAs; Dependabot security alerts and OpenSSF Scorecard monitoring are enabled.
  • See SECURITY.md⁠ for vulnerability reporting.

⁠Build Locally

git clone https://github.com/dgcosenza/syncthing-docker.git
cd syncthing-docker

docker buildx build \
  --platform linux/amd64 \
  --load \
  --build-arg IMAGE_CREATED="$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  --build-arg IMAGE_REVISION="$(git rev-parse HEAD)" \
  -t dgcosenza/syncthing:local \
  .

./tests/smoke.sh dgcosenza/syncthing:local
Build ArgDefaultPurpose
GO_BASEgolang:1.27.4-trixie@sha256:...Digest-pinned official Go builder image (refreshed daily by CI)
DEBIAN_BASEdebian:trixie-slim@sha256:...Digest-pinned Debian 13 runtime base image (refreshed daily by CI)
GO_VERSION1.27.4Go toolchain version metadata
SYNCTHING_VERSIONv2.1.7syncthing/syncthing Git tag
SYNCTHING_UID / SYNCTHING_GID1000 / 1000Default syncthing account IDs

⁠Update Policy

.github/workflows/daily.yml⁠ runs automatically every day at 05:50 UTC, on pushes to main, on pull requests (verification only), and via workflow_dispatch:

  1. Preflight & upstream check: Runs public-content checks, Hadolint, and Gitleaks; resolves the latest syncthing/syncthing release via authenticated GitHub API plus latest Go trixie and debian:trixie-slim digests; diffs against versions.json and emits upstream-changes.md.
  2. Multi-arch no-cache rebuild: Refreshes golang.org/x/{net,crypto,sys}, compiles Syncthing (-no-upgrade, CGO_ENABLED=0) natively on linux/amd64 and linux/arm64 runners with --no-cache on schedule and full Debian 13 apt-get upgrade.
  3. Smoke, Dive & vulnerability gates: Runs tests/smoke.sh⁠ natively on both architectures (drop-in PUID/PGID + strict --user 1000:1000 --read-only --cap-drop ALL), enforces the strict Dive efficiency gate (>= 95%, <= 5% wasted), generates Syft SPDX + CycloneDX SBOMs, and gates publication on 0 fixable findings of any severity in both Trivy and Grype (SBOM scan).
  4. Dual-registry publish & signing: Assembles the multi-arch OCI index on GHCR (ghcr.io/dgcosenza/syncthing) and mirrors the identical digest to Docker Hub (dgcosenza/syncthing) with tags latest, <version>, <version>-<YYYYMMDD>, and sha-<short>; keyless-signs digests and attaches SPDX/CycloneDX SBOM attestations via Cosign OIDC; emits SLSA Build L3 provenance; and publishes a signed GitHub Release.
  5. Automated documentation sync: Commits updated versions.json, the README Current Versions block, and a dated CHANGELOG.md entry via github-actions[bot] ([skip ci]), then syncs the Docker Hub overview and short description.
  6. Failure alerting: Opens or updates a single GitHub issue labeled ci-failure on any main or scheduled failure, and closes it automatically on the next green run.

⁠Design Decisions

  • Source build with refreshed Go security dependencies: Upstream prebuilt tarballs can ship lagged golang.org/x/* dependencies; rebuilding from official release tags clears binary CVEs immediately.
  • Debian 13 (trixie-slim) + tini + setpriv instead of Alpine + s6-overlay: Preserves full linuxserver/syncthing parity with a concise, auditable POSIX entrypoint while supporting strict rootless read-only operation.
  • Two-layer zero-waste runtime layout: Upgrading Debian 13 inside an os-base stage and assembling the final image with cleanly separated OS and compiled-binary layers eliminates overwritten base-layer files so Dive remains at ~100% efficiency and ~0% wasted space across daily security rebuilds.
  • Built with -no-upgrade: Disables in-container self-upgrades so all updates flow through immutable signed images.
  • Hadolint DL3008 ignore: Daily --no-cache security rebuilds intentionally pull the newest Debian 13 security updates via apt-get rather than pinning stale package versions.

⁠License

This repository follows a clear packaging-vs-upstream license split:

  • Container packaging, entrypoint, CI workflows, scripts, and documentation (packaging: MIT): Licensed under the MIT License⁠ — copyright Daniel G. Cosenza from FNX Labs.
  • Bundled upstream software — Syncthing (upstream: MPL-2.0): Copyright The Syncthing Authors — licensed under the Mozilla Public License 2.0 (MPL-2.0)⁠.

Full notices are preserved inside the image (/usr/share/doc/syncthing-notices/LICENSE) and in THIRD-PARTY-NOTICES.md⁠.


⁠Credits

Tag summary

Content type

Image

Digest

sha256:6da4fa46c…

Size

50.3 MB

Last updated

about 12 hours ago

docker pull dgcosenza/syncthing