Sachin helps you increase the
10-GiB storage limit with Docker
container volumes for ECS

Sachin_BLR0718

I want to increase my Docker container storage volume limit for Amazon Elastic Container Service (Amazon ECS) instances. How can I do this?

By default, Docker allocates 10 gibibytes (GiB) of storage for each volume it creates on an Amazon ECS container instance. If a volume reaches the 10-GiB limit, then you can't write any more data to that volume. Attempting to do so can cause the container instance to crash.

Note: The following instructions apply to instances using the devicemapper storage driver.  

1.    Open the Amazon ECS console.

2.    In the navigation pane, choose Clusters.

3.    Choose the cluster with the container instance where you want to increase the storage volume limit.

4.    Choose the ECS Instances view.

5.    Connect to your container instance using SSH.

6.    To see the storage size of your volumes, run the following command:

$sudo lsblk

In the console, you'll see that the size of the container volumes is 10G (equivalent to 10 GiB).

7.    To increase the default storage allocation for Docker volumes, set the dm.basesize storage option to a value higher than 10 GiB.

Important: After setting the dm.basesize value, any new images that are pulled by Docker use the new storage value that you set. However, any containers that were created or running before you changed the value will still use the previous storage value.

If you want to apply the dm.basesize option to all your containers, set the value of the option before the Docker service starts. For example, you can use the following script to set the default volume allocation to 20 GiB:

#cloud-boothook
#!/bin/bash

cloud-init-per once docker_options echo 'OPTIONS="${OPTIONS} --storage-opt dm.basesize=20G"' >> /etc/sysconfig/docker

8.    To verify that your Docker storage volumes are set above the default 10-GiB limit, run the following command:

$sudo lsblk

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center.

Published: 2017-05-17

Updated: 2019-03-29