How to increase base device size per container (with devicemapper as storage driver)?

While building a container (the same happens when I just run the same commands inside a container) I’ve run into an error complaining about “no space left on device”. I checked with df and confirmed that I have enough space. My OS is Arch Linux, here is output of docker info:

[mark@arch stackage-head]$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 123
Server Version: 18.03.0-ce
Storage Driver: devicemapper
 Pool Name: docker-8:3-5898903-pool
 Pool Blocksize: 65.54kB
 Base Device Size: 10.74GB
 Backing Filesystem: xfs
 Udev Sync Supported: true
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 45.27GB
 Data Space Total: 107.4GB
 Data Space Available: 56.87GB
 Metadata Space Used: 36.01MB
 Metadata Space Total: 2.147GB
 Metadata Space Available: 2.111GB
 Thin Pool Minimum Free Space: 10.74GB
 Deferred Removal Enabled: true
 Deferred Deletion Enabled: true
 Deferred Deleted Device Count: 0
 Library Version: 1.02.146 (2017-12-18)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.15.11-1-ARCH
Operating System: Arch Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.58GiB
Name: arch
ID: VKYM:3FM2:MAE7:SZPY:E4CR:6U6K:Z5SG:5A66:NEJT:K4MD:LN57:FBXM
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: mrkkrp
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
         Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

I tried using the --storage-opt size=20G option but it fails like so:

[mark@arch stackage-head]$ docker run -it --storage-opt size=20G snoyberg/stackage:nightly bash
docker: Error response from daemon: Failed to grow rootfs:exit status 1:xfs_growfs: /dev/mapper/docker-8:3-5898903-3456c9ee1d5a83fc705125974101c89015562d0cc4c00bc5e1c97bd560dded6a-init is not a mounted XFS filesystem.
See 'docker run --help'.

As per the docs this should work.

I checked Arch Linux wiki, which has a relevant section:

However I’m not sure how this applies to me because I don’t have XFS filesystem mounted in /etc/fstab, as I understand devicemapper creates them as needed for containers.

A container cannot grow larger than this “base device size” so I tried to increase it in various ways.

  • With docker daemon --storage-opt dm.basesize=20G as per this oldish post (link dropped to satisfy your rules for new forum users). Alas, --storage-opt is reported as an unknown flag.

  • By passing --storage-opt dm.basesize=20G to docker run, but this time dm.basesize is reported as an unknown option.

Is there a way to increase base device size that works with modern Docker versions?