Reputation: 10095
One of my steps in Dockerfile
requires more than 10G space on disk. It really does. However, all the intermediate containers in docker build
are created with 10G volumes.
What I did:
dockerd
with --storage-opt dm.basesize=25G
(docker info
says: Base Device Size: 26.84 GB
)It's no good: df -h
in an intermediate container still shows a 10G
disk, and docker inspect
of it shows "DeviceSize": "10737418240"
.
What have I missed? How do I increase the base volume size?
Upvotes: 10
Views: 14397
Reputation: 11802
To grant containers access to more space, we need to take care of two things:
--storage-opt dm.basesize=25G
Example:
--storage-opt dm.basesize=25G
docker run -it --rm ubuntu:xenial df -h
docker rmi ubuntu:xenial
docker pull ubuntu:xenial
docker run -it --rm ubuntu:xenial df -h
Upvotes: 3
Reputation: 373
I am not sure if this problem has been resolved in the meantime or not. But if anyone stumbles across this in 2019 (or possibly later), the clean solution to this kind of problems is to switch to another storage backend.
To do this, copy all keepworthy Docker data to a safe location. Stop the Docker daemon. Delete /var/lib/docker
(or move it away to allow a rollback if anything goes wrong). Then re-create an empty /var/lib/docker
and add file daemon.json
with the following content
{
"storage-driver": "overlay2"
}
Then, restart the Docker daemon and the artificial 10G limit is gone.
See the documentation for further details: https://docs.docker.com/storage/storagedriver/overlayfs-driver/
In case there is really no way around the DeviceSize
thing, I remember once creating it by hand (in the sense of a dd
command with the expected device size) and starting the Docker daemon afterwards. However, as of today, necessity for doing this should be gone.
Upvotes: 2