Docker Community Forums

Share and learn in the Docker community.

Increase build mount in container

Looking for a way to increase / mount in a docker image from 10 to 30. I tried the below, but then was unable to run a docker build. I am running on a linux optimized centos aws ec2 instance, docker engine version 19.03.6-ce. Thank you :).

Modify the docker config in /etc/sysconfig/docker-storage to add the line:
DOCKER_STORAGE_OPTIONS= - -storage-opt dm.basesize=30G
service docker stop
rm /var/lib/docker NOTE THIS DELETES ALL IMAGES etc. SO MAKE A BACKUP
service docker start
docker load < [each_save_in_backup.tar]
docker run -i -t [imagename] /bin/bash

Also tried:

sudo nano/etc/sysconfig/docker-storage adding --storage-opt dm.basesize=100G to the parameters and restarted the docker daemon

but that didn’t seem to help:

current

Filesystem  Size    Used      Available  Use %  Mounted on
                    9.8G   655.6M  8.6G          7%        /