|
1 天之前 | |
---|---|---|
.github | 3 周之前 | |
assets | 5 年之前 | |
cmd | 1 月之前 | |
etc | 1 月之前 | |
gui | 3 周之前 | |
internal | 3 周之前 | |
lib | 1 天之前 | |
man | 1 月之前 | |
meta | 5 月之前 | |
proto | 1 月之前 | |
relnotes | 1 月之前 | |
script | 1 月之前 | |
test | 2 月之前 | |
.codecov.yml | 4 年之前 | |
.deepsource.toml | 4 年之前 | |
.gitattributes | 8 年之前 | |
.gitignore | 6 月之前 | |
.golangci.yml | 1 月之前 | |
.policy.yml | 1 周之前 | |
.yamlfmt | 2 年之前 | |
AUTHORS | 1 月之前 | |
CONDUCT.md | 7 年之前 | |
CONTRIBUTING.md | 1 月之前 | |
Dockerfile | 1 年之前 | |
Dockerfile.builder | 1 年之前 | |
Dockerfile.stcrashreceiver | 1 年之前 | |
Dockerfile.stdiscosrv | 1 年之前 | |
Dockerfile.strelaypoolsrv | 1 年之前 | |
Dockerfile.strelaysrv | 1 年之前 | |
Dockerfile.stupgrades | 1 年之前 | |
Dockerfile.ursrv | 1 年之前 | |
GOALS.md | 2 年之前 | |
LICENSE | 8 年之前 | |
README-Docker.md | 2 周之前 | |
README.md | 10 月之前 | |
buf.gen.yaml | 10 月之前 | |
buf.yaml | 10 月之前 | |
build.go | 2 月之前 | |
build.ps1 | 5 年之前 | |
build.sh | 5 月之前 | |
compat.yaml | 4 月之前 | |
go.mod | 1 月之前 | |
go.sum | 1 月之前 |
Use the Dockerfile in this repo, or pull the syncthing/syncthing
image
from Docker Hub.
Use the /var/syncthing
volume to have the synchronized files available on the
host. You can add more folders and map them as you prefer.
Note that Syncthing runs as UID 1000 and GID 1000 by default. These may be
altered with the PUID
and PGID
environment variables. In addition
the name of the Syncthing instance can be optionally defined by using
--hostname=syncthing
parameter.
To grant Syncthing additional capabilities without running as root, use the
PCAP
environment variable with the same syntax as that for setcap(8)
.
For example, PCAP=cap_chown,cap_fowner+ep
.
To set a different umask value, use the UMASK
environment variable. For
example UMASK=002
.
Docker cli
$ docker pull syncthing/syncthing
$ docker run --network=host -e STGUIADDRESS= \
-v /wherever/st-sync:/var/syncthing \
syncthing/syncthing:latest
Docker compose
---
version: "3"
services:
syncthing:
image: syncthing/syncthing
container_name: syncthing
hostname: my-syncthing
environment:
- PUID=1000
- PGID=1000
- STGUIADDRESS=
volumes:
- /wherever/st-sync:/var/syncthing
network_mode: host
restart: unless-stopped
healthcheck:
test: curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o --color=never OK || exit 1
interval: 1m
timeout: 10s
retries: 3
Please note that Docker's default network mode prevents local IP addresses
from being discovered, as Syncthing can only see the internal IP address of
the container on the 172.17.0.0/16
subnet. This would likely break the ability
for nodes to establish LAN connections properly, resulting in poor transfer
rates unless local device addresses are configured manually.
It is therefore strongly recommended to stick to the host network mode, as shown above.
Be aware that syncthing alone is now in control of what interfaces and ports it listens on. You can edit the syncthing configuration to change the defaults if there are conflicts.
By default Syncthing inside the Docker image listens on 0.0.0.0:8384
. This
allows GUI connections when running without host network mode. The example
above unsets the STGUIADDRESS
environment variable to have Syncthing fall
back to listening on what has been configured in the configuration file or the
GUI settings dialog. By default this is the localhost IP address 127.0.0.1
.
If you configure your GUI to be externally reachable, make sure you set up
authentication and enable TLS.