2

I am having docker container with Ubuntu installed which was running with Nvidia docker But now I connected that HDD in a different computer. Now After typing following command in newly assembled system

sudo docker start container

I am getting error something like Unable to create /etc/nvidiactl

It seems like it needs Nvidia GPU to run that container which I don't have. So how can I get the data which is there in the container if i am unable to start it?

2

So what you can do is you list all of your containers with command:

docker container ls -a

And the second field is an image name, you can run this command to get all the read-only layers with their respective directories to search for the file in:

docker image inspect <image_id> | jq '.[0].GraphDriver.Data.LowerDir' -r | tr ":" "\n"

If the file was something written inside the container replace Lower with Upper.

In case you are on Mac the /var/lib/docker is inside the virtual machine and so you have to first enter that before you can get to those directories described in the command above. You can do it using nsenter like this:

docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh
0

This answer assumes a completely broken installation, i.e. no docker xxx commands work (though the OP did not say that explicitely). If I guessed wrong and they do work, then please refer to Jiri Klouda's answer instead.

Docker manages all the data in /var/lib/docker. Look around, you should immediately be able to find it. The top level directory names are hashes, and thus look pretty garbled, but below that you have the regular file system(s) of your images and containers. All those "onionized" filesystem layers will still be there if you didn't delete them. You can search using the usual command line tools (find etc.), filtering by date, file size, file name, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.