4
4

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.

Dockerエンジン更新時には気を付けろ

4
Last updated at Posted at 2015-08-19

Dockerは頻繁に更新されていますが、更新時に注意が必要です。
リリース状況は、こちらで確認できます。https://github.com/docker/docker/releases

Dockerコンテナは、Dockerデーモンが親プロセスになっています。
下のps結果を見てもらえばわかると思いますが、docker runで実行したリクエストはDockerデーモンで処理されます。詳しくは、Docker調査20150704を見てください。

# ps -ef | grep docke[r]
root      1262     1  0 00:20 ?        00:00:00 /usr/bin/docker -d --selinux-enabled
root      2669  2619  0 00:27 pts/1    00:00:00 docker run -it -name centos_homma_7 centos:7 /bin/bash
root      2826  2800  0 00:38 pts/3    00:00:00 docker run -it -name centos_homma_7_02 centos:7 /bin/bash 

# ps -ef | grep "/bin/bas[h]"
root      2669  2619  0 00:27 pts/1    00:00:00 docker run -it -name centos_homma_7 centos:7 /bin/bash
root      2710  1262  0 00:27 pts/2    00:00:00 /bin/bash
root      2826  2800  0 00:38 pts/3    00:00:00 docker run -it -name centos_homma_7_02 centos:7 /bin/bash
root      2864  1262  0 00:38 pts/4    00:00:00 /bin/bash

# ps -ef | grep "126[2]"
root      1262     1  0 00:20 ?        00:00:00 /usr/bin/docker -d --selinux-enabled
root      2710  1262  0 00:27 pts/2    00:00:00 /bin/bash
root      2864  1262  0 00:38 pts/4    00:00:00 /bin/bash

Dockerデーモンが落ちると、子プロセスも停止してしまうので、子プロセスであるDockerコンテナは影響を受けてしまいます。そのため、yum updateでDockerのバージョンを更新しようとすると、Dockerデーモンが一度停止する必要があるので、すべてのコンテナが停止してしまいます。

通常であれば、Dockerデーモンのバージョンをあげてもコンテナまで影響しないのがよい(そのように考えてしまいますが)と思いますが、現在のDockerはそのようになっていません。更新するときは要注意です。大事なコンテナが動いているときは更新してはいけません。

DockerもKVMのように、ライブマイグレーション的な機能がつく日が来るのでしょうか。しかしまだまだ先のような気がしています。
Openshiftはそのあたりどうなっているんだろうか。。。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?