侧边栏壁纸
博主头像
杰维特牡博主等级

行动起来,活在当下

  • 累计撰写 37 篇文章
  • 累计创建 7 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Syncthing搭建教程

Administrator
2023-11-12 / 0 评论 / 0 点赞 / 16 阅读 / 3806 字

Syncthing搭建教程

参考地址

2. 项目展示

GitHub项目地址:https://github.com/syncthing/syncthing

文档地址:https://docs.syncthing.net/intro/getting-started.html

客户端下载:https://github.com/syncthing/syncthing/releases

本文用的Docker镜像:https://hub.docker.com/r/linuxserver/syncthing

建目录

mkdir -p /root/data/docker_data/syncthing

cd /root/data/docker_data/syncthing

nano docker-compose.yml

本文用的Docker镜像:https://hub.docker.com/r/linuxserver/syncthing

镜像支持多种架构,如x86-64、arm64和armhf。

架构(Architecture)

标签(Tag)

x86-64

amd64-latest

arm64

arm64v8-latest

armhf

arm32v7-latest

vim docker-compose.yml

​docker-compose.yml​​填入以下内容:

原始代码:

version: "2.1"
services:
  syncthing:
    image: lscr.io/linuxserver/syncthing
    container_name: syncthing
    hostname: syncthing #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
    volumes:
      - /root/data/docker_data/syncthing/config:/config
      - /root/data/docker_data/syncthing/Documents:/Documents
      - /root/data/docker_data/syncthing/Media:/Media
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

修改后的:

version: "2.1"
services:
  syncthing:
    image: lscr.io/linuxserver/syncthing
    container_name: syncthing
    hostname: syncthing #optional
    environment:
      - PUID=0
      - PGID=0
      - TZ=Asia/Shanghai
    volumes:
      - /root/docker/syncthing/config:/config
      - /root/docker/syncthing/Documents:/Documents
      - /root/docker/syncthing/Media:/Media
      - /root/docker/flare:/flare
      - /root/docker/flare2:/flare2
      - /root/path/to/music:/Navidrome
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

PUID和PGID可以通过命令行输入id user​​来查看。

docker-compose up -d

2023-11-12_105129.jpg


cd /root/docker/syncthing/

docker-compose down 

rm -rf /root/docker/syncthing/  # 完全删除映射到本地的数据

0

评论区