If you're using the devicemapper graph engine, then storage-opt dm.basesize is the way to go for what you are trying to do. You need to clean out your /var/lib/docker after changing the configuration (note this will wipe all images you currently have, even if you use direct block devices to provision the data and metadata pool devices).
Here are the steps I followed:
$ docker run -ti base/arch df -h /
Filesysem Size Used Avail Use% Mounted on
/dev/mapper/docker-254:7-73733-b8dc...6d28a 9.8G 335M 8.9G 4% /
So I currently have the default 10G base size.
First, change the configuration to add "--storage-opt dm.basesize=5G":
# vim /etc/systemd/system/docker.service
...
ExecStart=/usr/bin/docker -d -H fd:// -s devicemapper \
--storage-opt dm.datadev=/dev/vg01/docker-dm-data \
--storage-opt dm.metadatadev=/dev/vg01/docker-dm-meta \
--storage-opt dm.basesize=5G
Then, stop Docker (make sure all containers are stopped beforehand, reload config, cleanout /var/lib/docker and restart Docker:
# systemctl stop docker
# systemctl daemon-reload
# rm -rf /var/lib/docker
# systemctl start docker
"docker images" should confirm no images are present.
And now rerun the test:
$ docker run -ti base/arch df -h /
Unable to find image 'base/arch:latest' locally
Pulling repository base/arch
a64697d71089: Download complete
511136ea3c5a: Download complete
4bbfef585917: Download complete
Status: Downloaded newer image for base/arch:latest
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/docker-254:7-66094...f635ac65 4.8G 322M 4.3G 7% /
And there we have a 5Gb base size.