13
18

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コンテナをイメージに保存する

Posted at

コンテナ上に作った環境をコピーしたり移行したりしたいときに。

Dockerコンテナのコンソール上で、Ctrl-p+Ctrl-qを押してコンテナをデタッチします。

bash(Dockerホスト)
sudo docker commit -m "環境の説明とかを書きます" コンテナID イメージ名

保存されていることを確認します。

bash(Dockerホスト)
sudo docker images

参考にしました
https://qiita.com/tubone/items/a3bad04abf4c700cae3d
http://aics-app.sakura.ne.jp/blog/2015/01/06/docker-%E3%81%A7-%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%81%AE%E4%BF%9D%E5%AD%98commit/

13
18
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
13
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?