matth3o
matth3o

Reputation: 3719

docker - change storage folder dynamically

Is it possible to specify with an option docker run [option] the location where the container will be stored ?

I'd like to avoid to migrate all existing containers before changing storage folder.

Thanks for your help.

Upvotes: 1

Views: 73

Answers (1)

gile
gile

Reputation: 6006

No, it isn't possible.

You could play with symlinks for existing images, volumes, containers after having changed data storage. e.g.

sudo ln -s /var/lib/docker/containers/52d23908ea920a244ced21afc8ceed0cb367089a937b9028cf2dcfd7b41fa66a /mnt/newStarageLocation/containers/52d23908ea920a244ced21afc8ceed0cb367089a937b9028cf2dcfd7b41fa66a

but in my opinion it would be very dirty and dangerous.

Upvotes: 1

Related Questions