0

I am trying to mount my entire docker debian container into /home/admin/main directory of my vps as a backup and migration solution but I get an error.

Command Used

sudo docker run -ditv /home/admin/main:/ debian /bin/bash

Error Received

docker: Error response from daemon: invalid volume specification: '/home/admin/main:/': invalid mount config for type "bind": invalid specification: destination can't be '/'.  See 'docker run --help'.

Thanks for your help in advance

4
  • not quite sure what you want to achieve with this? I find it quite logical that a container can't have its root directory be an external volume! What's the motivation behind doing this? Commented Jul 4, 2022 at 20:51
  • @MarcusMüller I am newbie. I am not sure what to backup so I am trying to backup from root. So I will not miss if anything goes wrong. Can you guide be how should I backup my container using volumes in the best way. So that in case if I want to migrate to a new VPS I just can migrate the volumes and start again without missing anything.
    – zakadmin
    Commented Aug 4, 2022 at 5:50
  • docker save does that Commented Aug 4, 2022 at 10:08
  • To be clear, docker save creates a tarball containing the layers in a container image; if the goal here is to create a backup of volumes, it won’t help. Commented Aug 4, 2022 at 11:32

0

You must log in to answer this question.

Browse other questions tagged .