Cannot increase size for docker container – Ubuntu 16.04

I tried running

docker run --memory=16g -ti -v [...]

But on my other terminal when I run docker stats, it always show that

  • docker instance of masterless salt showing folders of my system
  • Can't push to remote docker registry
  • Why can't I ping docker container?
  • SpringBoot @RestController not accessible from outside docker container
  • DOCKER + PDO: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
  • kubernetes pod can't connect (through service) to self, only to other pod-containers
  • MEM USAGE / LIMIT 48.89 MiB / 3.724 GiB
    

    And it seems like 3.724Gb is the upper bound of the limit – if I rerun with only --memory=1G then it will accept.

    Can I increase/change this?

  • Running Angular2 application in Docker
  • Dockerizing a gradle build on a Mac
  • Error on Zookeeper cluster mode with Docker?
  • CoreOS Single Container High Memory Usage
  • Unable to connect to Docker container from host
  • How to remove docker completely from ubuntu 14.04
  • One Solution collect form web for “Cannot increase size for docker container – Ubuntu 16.04”

    Docker can’t allocate more memory to a container than the docker host has available. If you check docker info, you should see the 3.724 limit. If you are on Windows or MacOS, then docker is running inside of a VM under the covers, and that VM has a limit on how much of your memory is allocated to it. You can adjust this limit by changing the settings on the VM (in some versions, this is available in the docker preferences).

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