Recover Docker from backuped /var/lib/docker directory

everyone. Let me explain my current state.

Yesterday I had updated my Debian computer and unfortunately, package crash occurred and I have been failing to boot it again. So I dumped the entire system volume to another EXT4 drive via Rsync.

I almost succeed to backup my files, except for one: Docker. Though I have entire, not-damaged /var/lib/docker directory, I don’t know how to restore it to my new Ubuntu. I tried copying the entire directory, but docker container ls shows that none of the containers were copied at all.

Of course I know that Docker backup is not done by copying /var/lib/docker: the right way is to create a new image and store it. However I didn’t get chance to do that and I cannot login to my previous Linux environment: only to my previous system volume.

In short, I have the previous entire system backup, including /var/lib/docker, but cannot login to it. I want to restore all of my previous Docker images, containers, volumes, network data, and so on.

Source: StackOverflow