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

I installed docker 0.11.1 on top of Ubuntu 12.04. I am trying to change shmax from a fixed value (32 M) to something bigger (1G) from inside the docker when I run the command

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

This is because it is /procinstalled roin the container.

Can someone tell me how to mount proc like r/win my container to change it?

+4
source share
3 answers

I was lucky:

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

sysctl, , 1.12+ -sysctl ( ), .

, , dockerfile.

https://docs.docker.com/engine/reference/commandline/run/#configure-namespaced-kernel-parameters-sysctls-at-runtime

docker run --sysctl kernel.shmmax=1073741824 yourimage

docker-compose.yml( 2.1):

version: '2.1'
services:
    app:
        sysctls:
            - kernel.shmmax=1073741824
0

. sysctl - , , .

, .

-1

Source: https://habr.com/ru/post/1541845/


All Articles