One simple Docker trick to halve your image build time

Note: with support for Overlay storage driver for InterSystems IRIS containers this article is no longer relevant. The article is left here for archive purposes.


When starting with containers and docker it's important to remember to set correct storage driver value. InterSystems IRIS container supports devicemapper storage driver on Linux and it can be used in two modes:

  • loop-lvm
  • direct-lvm

The first and easy approach called loop-lvm is to edit docker configuration and add this line

  "storage-driver": "devicemapper"

That certainly seems simple. But both InterSystems documentation and Docker documentation state:


be sure to read Docker’s explanation of using the devicemapper storage driver in direct-lvm mode for management of container images


Production hosts using the devicemapper storage driver must use direct-lvm mode. This mode uses block devices to create the thin pool. This is faster than using loopback devices, uses system resources more efficiently, and block devices can grow as needed. However, more set-up is required than loop-lvm mode.

direct-lvm is certainly the recommended, if harder to configure approach. But how faster is it? That depends upon how much time you  spend reading/writing to the image, but I've been able to observe 2-3x speed-up time for a real-world application (not a test app, hundreds of classes, etc.). After moving from loop-lvm to direct-lvm the image build time and associated operations are now completed ~60% faster than before.


Hi, Ed! Thanks!

And how docker configuration looks like to go with direct-lvm?

What do you mean? How does it look in config file?

In the best case like this:

  "storage-driver": "devicemapper",
  "storage-opts": [

Docker documentation explains setting direct-lvm in detail.