LoginSignup
11
8

More than 5 years have passed since last update.

ChromeOS/Crostini で Docker が動かなくなる問題の解決

Last updated at Posted at 2018-09-08

問題

ChromeOS の 69.0.3473.0 あたりから, Docker を chrostini で動かそうとするとこんなことを言われてしまう

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"could not create session key: function not implemented\"": unknown.

対症療法

Chrome 上で Ctl+Alt+T で crosh を呼び出し,

crosh> vmc start termina
(termina) chronos@localhost ~ $ lxc profile unset default security.syscalls.blacklist
(termina) chronos@localhost ~ $ lxc profile apply penguin default
(termina) chronos@localhost ~ $ lxc restart penguin

として,terminal を再起動すると治る.ただ,penguinが起動するたびにやり直さなければいけないために相当めんどくさい.以下に書かれているようにバージョンアップを待つしかなさげだ.
https://bugs.chromium.org/p/chromium/issues/detail?id=860565

(2018-09-20)追記:
以下で永続化できるようだ

lxc profile unset default security.syscalls.blacklist
lxc profile copy default newprofile
lxc profile apply penguin default,newprofile
lxc restart penguin

gVisor

エラーはコンテナのランタイム runc で起こっている.そこで,このランタイムを google 謹製の gVisor で置き換えるという手がある.
https://github.com/google/gvisor

以下のように導入

wget https://storage.googleapis.com/gvisor/releases/nightly/latest/runsc
wget https://storage.googleapis.com/gvisor/releases/nightly/latest/runsc.sha512
sha512sum -c runsc.sha512
chmod a+x runsc
sudo mv runsc /usr/local/bin

etc/docker/daemon.json に以下のように記述

{
    "runtimes": {
        "runsc": {
            "path": "/usr/local/bin/runsc"
        }
    }
}

して, sudo systemctl restart docker でサービスを再起動すると,

docker run --runtime=runsc hello-world

みたいにして使える.デフォルトにしたかったら, daemon.json に
"default-runtime": "runsc"を加えて以下のようにしてみるとよいだろう.ただしこの方法は,nvidia-docker とかとは共生できないかもしれない.

{
    "runtimes": {
        "runsc": {
            "path": "/usr/local/bin/runsc"
        }
    },
    "default-runtime": "runsc"
}
11
8
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
11
8