How to remount the proc filesystem in a docker as a r/w system?

I have installed docker 0.11.1 over Ubuntu 12.04.
I am trying to change the shmmax from its fixed value (32 M) to something bigger (1G)
from within the docker when I run the command

sysctl -w kernel.shmmax=1073741824
error: "Read-only file system" setting key "kernel.shmmax"

That is because /proc is mounted ro in the container.

  • Access IP address of Couchbase container on Docker Swarm cluster
  • Trying to create postgis inside docker file gives the error
  • Python script for creating docker container using Remote API
  • Is it acceptable to create tests relying on docker for a node.js module?
  • allow insecure registry in host provisioned with docker-machine
  • how to pass a --login into docker build
  • Can someone tell me how to mount the proc as r/w in my container to change it?

  • Which commands of the defined Linux Distribution are available in a Docker container?
  • docker with pycharm 5
  • Docker rm blocks concurrent runs
  • Is it a docker best practice to use volume for the code?
  • Can't connect Java program to MySQL using Docker
  • Puzzled by the cpushare setting on Docker.
  • 2 Solutions collect form web for “How to remount the proc filesystem in a docker as a r/w system?”

    I have had some luck like so:

    mount -o remount rw /proc/sys
    sysctl -w [your settings here]

    You don’t. sysctl values are not confined to the container — they affect the whole system, so it’s not appropriate for a container to be able to change them.

    If you want to set a higher value for this variable, do that from the host system.

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