Docker – Editing Mount Options

I am adding a disk quota to my Ubuntu docker container. To add quota support, I need to edit the mount options and add usrquota as explained here:

Usually you would edit /etc/fstab and add the mount option.

  • Capture the output of a program run in Docker
  • How to run Docker container in it's own network
  • Docker for a one shot CLI application
  • No such file or directory in docker build
  • Ansible roles task failing docker swarm node join
  • Problems with docker container to container communication on same host when firewalld/iptables is enabled
  • My question, how would I add a mount option to a docker container?

  • No suitable driver found for jdbc:postgresql when trying to connect spark-shell (inside a docker container) to my PostgreSQL database
  • Flow of registration between kafka and zookeeper
  • link command hangs when linking container to itself
  • What is [loop0] process for?
  • Not able to execute RUN commands in Dockerfile
  • Docker error resolve host and I/O error on POST request for http://es.example/oauth/check_token Connection refused
  • One Solution collect form web for “Docker – Editing Mount Options”

    You don’t really mount container’s disks anywhere. There is a feature request asking for setting quotas in Docker containers ( so at the moment there is no easy way.

    However, apparently there are a couple of workarounds.

    Use Device Mapper as a limit

    Docker containers have a maximum of 10GB of disk space, per container (that is the Device Mapper storage driver by default).

    So your best option is to change the default value for new containers, but then, it is my understanding you would need to rebuild the containers.

    So, if you want to enforce 5 gigabytes, you would write

    docker -d --storage-opt dm.basesize=5G


    User inside/quota outside

    The trick is create a specific user account in each container, and assign a userid for that account (and obviously run the command with that account).
    On the host, we would use setquota to limit this userid.


    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.