rsync:3.4.4,支持amd64;arm64v8;arm32v7,ssh+cron+rsync+lsyncd
10K+
自用rsync备份镜像,基础系统为alpine,支持amd64;arm64v8;arm32v7系统。 镜像中ssh、cron、rsync、lsyncd可自由组合使用以分别实现server/client模式。
项目地址:https://github.com/DoTheBetter/docker/tree/master/rsync
lsyncd、lsyncd+ssh或者rsync、rsync+cron、rsync+cron+sshcron或者cron+sshpasswd=$(tr -dc 'A-Za-z0-9!@#$%^&*()' < /dev/urandom | head -c64)在每次启动容器时自动生成64位随机密码。cron计划任务时,每隔1分钟检测/conf/crontabs规则变化并在变化时重启crond。rsync命令同步时,使用--port=8081指定rsync 端口(默认873),使用-e "ssh -p 2022"指定SSH端口。下面是可用于自定义安装的可用选项的完整列表。
| 变量名 | 是否必须 | 默认值 | 说明 |
|---|---|---|---|
TZ | 可选 | Asia/Shanghai | 设置时区 |
SSH | 可选 | false | ssh服务启用开关,true为开,false为关 |
CRON | 可选 | false | cron计划任务启用开关,true为开,false为关 |
RSYNC | 可选 | false | rsync daemon守护进程启用开关,true为开,false为关 |
LSYNCD | 可选 | false | lysncd daemon守护进程启用开关,true为开,false为关 |
| 范围 | 描述 |
|---|---|
22 | ssh端口 |
873 | rsync 端口 |
下面的目录用于配置,并且可以映射为持久存储。
| 目录 | 描述 |
|---|---|
/conf | 各服务的配置文件夹 |
/backup | 备份文件夹 |
本镜像在docker hub及ghcr.io同步推送,docker hub不能使用时可使用ghcr.io
docker run -d \
--name rsync \
--restart always \
-e SSH=true \
-e RSYNC=true \
-p 8872:22 \
-p 8873:873 \
-v /docker/rsync:/conf \
-v /backup:/backup \
dothebetter/rsync:latest
#ghcr.io/dothebetter/rsync:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/rsync:latest
version: '3'
services:
rsync:
image: dothebetter/rsync:latest
#ghcr.io/dothebetter/rsync:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/rsync:latest
container_name: rsync
restart: always
environment:
- SSH=true
- RSYNC=true
ports:
- "8872:22"
- "8873:873" #可选
volumes:
- /docker/rsync:/conf
- /backup:/backup
docker run -d \
--name rsync \
--restart always \
-e SSH=true \
-e CRON=true \
-v /docker/rsync:/conf \
-v /backup:/backup \
dothebetter/rsync:latest
#ghcr.io/dothebetter/rsync:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/rsync:latest
version: '3'
services:
rsync:
image: dothebetter/rsync:latest
#ghcr.io/dothebetter/rsync:latest
#registry.cn-hangzhou.aliyuncs.com/dothebetter/rsync:latest
container_name: rsync
restart: always
environment:
- SSH=true
- CRON=true
volumes:
- /docker/rsync:/conf
- /backup:/backup
Content type
Image
Digest
sha256:129f4d675…
Size
9.9 MB
Last updated
3 months ago
docker pull dothebetter/rsync