234
118

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のRUNとCMDの違い

Last updated at Posted at 2015-04-09

Dockerfileに

RUN service mysqld start

と書いたのに実際にコンテナの中に入ってみるとmysqlが立ち上がってないので、へんだなと思い、調べてみたのですが、ここはRUNでなくCMDを使うべきだったみたいです。

スクリーンショット 2015-04-09 10.56.59.png

上記の図に書いたのですが、

  • RUN:ビルド時にコンテナ内で実行される
  • CMD:完成したイメージからコンテナを作成するときに実行される

です。

234
118
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
234
118

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?