21
20

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のImageからDockerfileを取り出せるか?

Last updated at Posted at 2014-11-23

取り出せないようだが history コマンドで操作履歴を読み出すことでほぼほぼ同じことができそう。 --no-trunc オプションをつければ全文読むことができる。

これで docker run したとき、どういうコマンドが実行されているのかもわかって良い。

・・・むしろ他に方法があればぜひ教えていただきたいです >_<

[pharaohkj]$ docker history ping
IMAGE               CREATED             CREATED BY                                      SIZE
fccfda7de5ee        3 weeks ago         /bin/sh -c #(nop) CMD [/bin/sh -c ruby /root/   0 B
9ebfa82ca561        3 weeks ago         /bin/sh -c #(nop) ADD file:455a5361174c30b69a   414 B
9ef43ea1950d        3 weeks ago         /bin/sh -c ip a                                 0 B
4a8bc893d8ce        3 weeks ago         /bin/sh -c gem install --no-ri --no-rdoc etcd   2.588 MB
011ec0bedc3a        4 months ago        /bin/sh -c cd /root/                            0 B
a21d40582067        4 months ago        /bin/sh -c apt-get install ruby ruby-dev make   104.9 MB
fb7ee3b98e7c        4 months ago        /bin/sh -c apt-get update                       4.69 MB
cf9d9b748ef3        4 months ago        /bin/sh -c #(nop) MAINTAINER MASAYUKI KATOH k   0 B
e54ca5efa2e9        5 months ago        /bin/sh -c apt-get update && apt-get install    178.4 kB
6c37f792ddac        5 months ago        /bin/sh -c apt-get update && apt-get install    83.61 MB
83ff768040a0        5 months ago        /bin/sh -c sed -i 's/^#\s*\(deb.*universe\)$/   1.903 kB
2f4b4d6a4a06        5 months ago        /bin/sh -c echo '#!/bin/sh' > /usr/sbin/polic   194.5 kB
d7ac5e4f1812        5 months ago        /bin/sh -c #(nop) ADD file:adc47d03da6bb2418e   192.5 MB
511136ea3c5a        17 months ago                                                       0 B
21
20
1

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
21
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?