Build Docker Images on a Secondary Disk

Hi there :hugs:,

For our participation in Touché, we wanted to use docker. Since we rely on libraries like PyTorch and some language models, the docker image became too large for the initial disk of our virtual machine.

We received additional disk space from the TIRA team for our virtual machine (mounted at /mnt/data) that is also available during sandboxing, and I wanted to share the steps that we used to reconfigure our docker daemon in the virtual machine in the hope that this will be helpful to others in the future :slight_smile:

Step 1
Ask the administrators to get more disk space. They will provide you an external mount under /mnt/data.

Step 2
Create a docker directory under the newly mounted file systems.
$ mkdir /mnt/data/docker

Step 3
Configure the docker daemon to save its state (images, networks, volumes) under the newly created directory.
$ sudo echo "{\n\"data-root\": \"/mnt/data/docker\"\n}" > /etc/docker/daemon.json

Step 4
Restart the docker daemon.
$ sudo systemctl restart docker

Now, you should be able to build or download big docker images.
I hope it helps!

6 Likes