6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dead な Docker コンテナを起動・削除可能にするワンライナー

Posted at

Docker のデーモンがストーンと落ちてしまうと、走っていたコンテナが Dead 状態に陥ることがあります。

こうなると、デーモンを再起動して該当コンテナを起動・削除したくても、失敗することになります。

$ docker rm c39206003c7a
Error: Cannot destroy container c39206003c7a: Driver devicemapper failed to remove root filesystem c39206003c7ae8992a554a9ac2ea130327fc4af1b2c389656c34baf9a56c84b5: Error running removeDevice
2014/05/08 19:15:15 Error: failed to remove one or more containers

今のところ根本的な解決策はなく、とりあえず復旧するためのワンライナー(Docker 1.6.1)。

# awk '/mapper\/docker/ { print $2 }' /proc/mounts | xargs -r umount -f

ただし、最新の Docker ではこれが効かないという報告もあり、Docker の発展途上をまざまざと実感している次第です。

参考

After stopping docker, previously running containers cannot be started or removed #5684

6
6
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
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?