recovery data from stand alone docker container after accidentally deleted my vm on azure

I deleted my vm on azure but the disk still exist in resource group I mounted
a new machine and attach the disk[vhd] into it

I mounted the disk in /datadrive and I can see my docker container

can I make sudo docker start 74249224a191be10cf7f65609a373879a159c19d84d50656408dcd5ffdf2cb17
to get the generated data back no volume is attached on this container
I tried installing docker and copying the container from /datadrive/var/lib/docker/containers/ to its equivalent in the new machine but even after I copy the files I can’t start the container with error

Error response from daemon: No such container: 74249224a191be10cf7f65609a373879a159c19d84d50656408dcd5ffdf2cb17

Error: failed to start containers: 74249224a191be10cf7f65609a373879a159c19d84d50656408dcd5ffdf2cb17

Answer

According to you description, I suggest you had better recreate your VM by using your VHD. Based on my experience, docker depends on some system configuration not only /var/lib/docker/containers/. In your new VM, if you could not configure them correctly, you could not start your docker.

It is easy to recreate your VM by using this template.

After you recreate your VM, you could migrate docker container to another VM. This is a good answer about this.

Attribution
Source : Link , Question Author : Hady Rashwan , Answer Author : Community

Leave a Comment