Docker in LXC Container(Centos)


(Raj Nikhil Marpu) #1

I have migrated a Virtual Machine workload (which has docker up and running in that) to a Linux Container (Centos). Everything has been moved. I can see docker installed in the LXC Container, but docker service is down. I was trying to make docker service up and running. I have tried security.nesting=“true”, storage-driver=overlay2, I have also tried restarting the container after that with no luck, But if I take fresh LXC Container, I was able to install docker and make docker up and running.


#2

Can you describe the steps of the migration?
Did you use a tool or was it done manually?


(Raj Nikhil Marpu) #3

I used an online tool to lift and shift the workload.
But I see if I remove docker directory (sudo rm -rf /var/lib/docker) and once I restart the docker service, it is getting up and running. So, Basically, if I remove that directory all the images and containers gets deleted, this is known. I just don’t want to do that.
Is there a way to do that without deleting that directory?


(Stéphane Graber) #4

I suspect the issue is that Docker was using a storage backend which doesn’t work inside containers.
If you reset it, it re-initializes with something like aufs/overlay which works fine within containers whereas you may have been running with a block based backend on your source host.

I’m not familiar enough with Docker to know how to convert between backends and get things working after moving.