Docker Community Forums

Share and learn in the Docker community.

Setting up volumes / subvolumes / images /containers to user defined disk and folder

Hello all,

I’ve setup docker in opensuse 15.3 which are installed in an ssd of 40GB.

Am running a software called webodm and it creates so much data that it fills up my disk.

How can i tell docker to use an other folder than /var/lib/docker/ ?

Ive seen many posts online and most people just do a soft link to the folder , there must be some more elegant way.

Thank you for your time,
Best!

Hi :slight_smile:

create this file: /etc/docker/daemon.json
and in it, put:

{ "data-root": "/your/new/location" }

and restart docker, NOTE that your running containers and images will still excist in the old directory, so if you have any of these, and change data-root, your installation will be “clean”, so consider moving the data to the new location, if you have any data in the current placement of docker

Thank you kind sir !
Best wishes!