Using our ansible role, we spin up an m3.large instance, particularly because we want the 32GB SSD that it comes with.

However, when we install Docker on the instance, the default setting for storage is in /var/lib/docker, whereas our 32GB SDD storage is mounted at /mnt.

On an m3.large the /dev/xvda1 mount / has a size of 7.8GB, which is not enough for some of the images we'll be building: ideally, Docker images should be kept as small as possible, however, we need to build some rather large monolithic applications, so we really need the space at /mnt.

This is not a problem when running a container from an image, as we can simply map the volume:

-v /mnt/docker/data:/root/monolithic-app-storage \

However, when building an image, although we can specify the volume in the Dockerfile, we can't map it to a location on disk, and therefore are reliant on there being enough disk space where the Docker images are stored.

Theoretically, we can simply change the $DOCKER_OPTS and restart docker: