使用Volumerize用scp备份我的Docker卷? [英] Using Volumerize to backup my docker volumes with scp ?
问题描述
我有几个docker卷,我想使用scp/sftp备份到另一台服务器上.我不知道该如何处理,所以我决定看看 blacklabelops/volumerize GitHub项目.
I have a couple of docker volumes i want to backup onto another server, using scp/sftp. I don't know how to deal with that so i decided to have a look at blacklabelops/volumerize GitHub project.
此工具基于命令行工具 Duplicity .通过Dockerized和Parameterized进行更轻松的使用和配置. 教程正在与詹金斯码头工人打交道,但我不知道该怎么说使用pem文件.
This tool is based on the command line tool Duplicity. Dockerized and Parameterized for easier use and configuration. Tutorial is dealing with a jenkins docker, but i don't understand how to mention i'm want to use a pem file.
我尝试了不同的解决方案(在scp命令行中添加-i选项),但此刻没有任何成功.
I've tried different solution (adding -i option to scp command line) without any success at the moment.
重复手册页提到了使用cacert pem文件(--ssl -cacert-file选项),但是我想我必须在运行docker时创建一个env变量(带有-e选项),而且我不知道要使用哪个名称.
Duplicity man page is mentioning the use of cacert pem files (--ssl-cacert-file option), but i suppose i have to create an env variable when running the docker (with -e option), and i don't know which name to use.
这是我到目前为止所拥有的,有人可以向我指出正确的方向吗?
Here what i have so far, can someone please point me in the right direction ?
docker run -d --name volumerize -v jenkins_volume:/source:ro -v backup_volume:/backup -e "VOLUMERIZE_SOURCE=/source" -e "VOLUMERIZE_TARGET=scp://me@serverip/home/backup" blacklabelops/volumerize
推荐答案
选项--ssl-cacert-file
仅用于主机验证,不用于身份验证.
The option --ssl-cacert-file
is only for host verification not for authentication.
我已经找到了有关如何在scp命令中添加pem文件的示例:
I have found this example on how to add pem files inside an scp command:
scp -i /path/to/your/.pemkey -r /copy/from/path user@server:/copy/to/path
参数-i /path/to/your/.pemkey
可以在blacklabelops/volumerize中传递
与环境变量`VOLUMERIZE_DUPLICITY_OPTIONS``
The parameter -i /path/to/your/.pemkey
can be passed in blacklabelops/volumerize
with the env variable `VOLUMERIZE_DUPLICITY_OPTIONS``
示例:
$ docker run -d \
--name volumerize \
-v jenkins_volume:/source:ro \
-v backup_volume:/backup \
-e "VOLUMERIZE_SOURCE=/source" \
-e "VOLUMERIZE_TARGET=scp:///backup" \
-e 'VOLUMERIZE_DUPLICITY_OPTIONS=--ssh-options "-i /path/to/your/.pemkey"' \
blacklabelops/volumerize
这篇关于使用Volumerize用scp备份我的Docker卷?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!