Overview

Full name
docker.io/eeacms/rsync
Registry
docker.io
Namespace
eeacms
Repository
rsync
Cached tags
15
Last synced
07/06/2026, 02:02 PM

Introduction

EEA 维护的 rsync 客户端容器镜像,在 CI 或 Cron 任务中将目录增量同步至远程主机,适合静态站点与备份推送。

Details

eeacms/rsync 封装 rsync 与 openssh-client,通过环境变量或命令行指定源/目标路径,常用于 Jenkins/GitLab CI 将构建产物 rsync 到 nginx 源站。镜像定位为短生命周期同步任务而非常驻服务。与 alpine+rsync 自制镜像相比预装 SSH 密钥挂载惯例;Kubernetes 中应以 CronJob 运行,密钥经 Secret 注入,同步完成后 Pod 退出。

快速启动

docker run --rm \
  -v $(pwd)/site:/src \
  docker.io/eeacms/rsync:latest \
  rsync -avz /src/ user@backup-host:/var/www/html/

推荐实践

docker run --rm \
  -v /data/site:/src:ro \
  -v /data/.ssh:/root/.ssh:ro \
  -e RSYNC_DEST=user@prod:/var/www/html/ \
  docker.io/eeacms/rsync:1.0.0 \
  rsync -avz --delete /src/ $RSYNC_DEST

核心参数说明

  • -v .../site:/src:ro — 只读挂载待同步目录
  • -v .../.ssh:... — SSH 私钥(免密登录目标机)
  • --delete — 删除目标端多余文件(谨慎使用)
  • -avz — 归档模式、verbose、压缩传输
  • --rm — 同步完成即退出
  • 定位 — Cron/CI 一次性任务

Kubernetes

apiVersion: batch/v1
kind: CronJob
metadata:
  name: rsync-site
spec:
  schedule: "*/30 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: rsync
              image: docker.io/eeacms/rsync:1.0.0
              args:
                - rsync
                - -avz
                - --delete
                - /src/
                - user@backup.internal:/var/www/html/
              volumeMounts:
                - name: src
                  mountPath: /src
                  readOnly: true
                - name: ssh
                  mountPath: /root/.ssh
                  readOnly: true
          volumes:
            - name: src
              persistentVolumeClaim:
                claimName: site-content
            - name: ssh
              secret:
                secretName: rsync-ssh-key
                defaultMode: 0600

SSH 密钥 Secret 权限 0600;schedule 按 RPO 调整,目标主机防火墙仅允许 Job Pod 出口 IP。

Latest tags (20)

View all 15 tags →
TagArchPushed AtSizeDigestSyncWishAction
docker.io/eeacms/rsync
:3.0
linux/amd64
2025/09/26 12:539.5 MBsha256:e1e17256d41c
docker.io/eeacms/rsync
:latest
linux/amd64
2025/09/25 23:509.5 MBsha256:733f33d3b58c
docker.io/eeacms/rsync
:2.9
linux/amd64
2025/08/28 18:169.5 MBsha256:96316a63f264
docker.io/eeacms/rsync
:2.8
linux/amd64
2025/08/21 19:529.2 MBsha256:56aeda3cf22d
docker.io/eeacms/rsync
:2.7
linux/amd64
2025/07/11 19:359.2 MBsha256:ba7a1ca92a9b
docker.io/eeacms/rsync
:2.6
linux/amd64
2024/09/04 17:488.7 MBsha256:07244cc157ee
docker.io/eeacms/rsync
:2.5
linux/amd64
2024/08/09 00:508.7 MBsha256:51e0b7d748e4
docker.io/eeacms/rsync
:2.4
linux/amd64
2022/08/22 17:196.3 MBsha256:abdffb1f4d25
docker.io/eeacms/rsync
:2.3
linux/amd64
2019/12/07 02:226.4 MBsha256:913d20ab0e3a
docker.io/eeacms/rsync
:2.2
linux/amd64
2019/10/31 21:534.6 MBsha256:f469d35472fa
docker.io/eeacms/rsync
:2.1
linux/amd64
2019/03/14 00:534.6 MBsha256:15d3c851f1f2
docker.io/eeacms/rsync
:2.0
linux/amd64
2019/03/13 23:314.9 MBsha256:809b8015a371
docker.io/eeacms/rsync
:1.2
linux/amd64
2018/04/12 00:084.6 MBsha256:cae50e68ee93
docker.io/eeacms/rsync
:1.1
linux/amd64
2017/10/24 19:124.6 MBsha256:e7c9d39eac0e
docker.io/eeacms/rsync
:1.0
linux/amd64
2017/04/24 18:043.8 MBsha256:c37eaf09c235