How do I move a docker container's image to a persistent disk?

dvaini picture dvaini · Jan 31, 2014 · Viewed 11.7k times · Source

We have noticed that our containers are taking up a lot of space, one of the reasons for this is the images.

We would like to move the images.

I know right now they are stored in /var/lib/docker/graph/<id>/layer

Is there a way to move these to another location/persistent disk?

Answer

Ken A. picture Ken A. · Feb 7, 2014

To move images to another drive or another server:

docker save image_name > image_name.tar

mv image_name.tar /somewhere/else/

Load it back into docker

docker load < image_name.tar 

Reference.