LoginSignup
14
9

More than 5 years have passed since last update.

Dockerコンテナ上でsysctlでカーネルパラメータを変更する方法

Last updated at Posted at 2015-04-30

背景

Dockerコンテナで構築した開発環境で、guardを用いて開発していたところinotifyの不足によるエラーに遭遇した。
対策はguardのgithubページにある通りだが、sysctl -pを実行するとerror: "Read-only file system" setting key "vm.swappiness"というようなエラーに遭遇する。

対応

Dockerコンテナの起動時に、--privilegedオプションをつける。

% docker run --privileged --volumes-from dev -p 35729:35729 -p 2222:22 -p 80:3000 -itd osamunmun/centos6:1.1 /usr/sbin/sshd -D
14
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
9