Using Volumerize to backup my docker volumes with scp ?

旧城冷巷雨未停 提交于 2019-12-25 12:42:33

问题


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.

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.

I've tried different solution (adding -i option to scp command line) without any success at the moment.

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

回答1:


The option --ssl-cacert-file is only for host verification not for authentication.

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

The parameter -i /path/to/your/.pemkey can be passed in blacklabelops/volumerize with the env variable `VOLUMERIZE_DUPLICITY_OPTIONS``

Example:

$ 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


来源:https://stackoverflow.com/questions/45763862/using-volumerize-to-backup-my-docker-volumes-with-scp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!