Is is possible to define memory and disk space for a Docker Container?

Is is possible to define memory and disk space for a Docker Container?
Docker is replacement of Virtual Machines but I am confused about Docker’s resource utilization. I can set the resources to be used by particular VM at the time of installation but Docker does not provide this facility so, I want to know how Docker uses resources from the host machine?

  • Port forwarding: docker -> vagrant -> host
  • Docker Exec with OpenSSL and stdin, stdout
  • Executing Symfony Composer Update in Docker-Compose Results in Cache Error
  • Hypervisor is not running?
  • Is there an official Docker Engine security notices mailing list or other channel?
  • How to run Iojs in Docker?
  • i/o timeout error using progrium/docker-consul
  • Docker + Cassandra ulimit error
  • Docker error in Linux mint 17
  • Can't connect to Postgres container with Docker Compose from Sequelize
  • Slow meteor build performance in docker container
  • “update --memory” can not work
  • 2 Solutions collect form web for “Is is possible to define memory and disk space for a Docker Container?”

    The Docker Reference for Runtime constraints on resources says:

    -m, --memory=""     Memory limit (format: <number>[<unit>]). Number is a positive integer. Unit can be one of b, k, m, or g. Minimum is 4M.
    --memory-swap=""    Total memory limit (memory + swap, format: <number>[<unit>]). Number is a positive integer. Unit can be one of b, k, m, or g.
    --memory-reservation=""     Memory soft limit (format: <number>[<unit>]). Number is a positive integer. Unit can be one of b, k, m, or g.
    --kernel-memory=""  Kernel memory limit (format: <number>[<unit>]). Number is a positive integer. Unit can be one of b, k, m, or g. Minimum is 4M.
    

    and much more

    Yes.

    By default, containers (just like standard processes) can ask for all the system resources. However, you can start containers with fine-grained controls, limiting their resources and privileges.

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