title: Docker diff images
body: <p>I know the question has already been asked (a long time ago), but I cannot find any answer, so I ask it one more time: I have a "complex" (ie deep) tree of docker images locally, and I would like to see the difference between images.</p>
  
  <pre><code>[lgmasapp203 ~]$ docker images -t
  Warning: '-t' is deprecated, it will be removed soon. See usage.
  ├─64e5325c0d9d Virtual Size: 125.1 MB
  │ └─bf84c1d84a8f Virtual Size: 125.1 MB
  │   └─87de57de6955 Virtual Size: 169.5 MB
  │     └─6a974bea7c0d Virtual Size: 291.8 MB
  │       └─06c293acac6e Virtual Size: 292.6 MB
  │         └─b8a058108e9e Virtual Size: 292.6 MB
  │           └─9aa09af53eee Virtual Size: 292.6 MB
  │             └─a0513c939a75 Virtual Size: 292.6 MB
  │               └─f509350ab0be Virtual Size: 292.6 MB
  │                 └─b0b7b9978dda Virtual Size: 292.6 MB
  │                   └─6a0b67c37920 Virtual Size: 815.9 MB
  </code></pre>
  
  <p>I already tried <code>docker save &lt;image-id&gt;</code> method, then extract the tar file and compare the entries, but what I get is only a bunch of <code>json</code>, <code>VERSION</code> and <code>layer.tar</code> files:</p>
  
  <pre><code>[lgmasapp203 ~]$ find 226a
  226a
  226a/9aa09af53eeee5a36dfd4f0542cf61ec16c3c168e3b6303b49a7bd5b804b1f56
  226a/9aa09af53eeee5a36dfd4f0542cf61ec16c3c168e3b6303b49a7bd5b804b1f56/json
  226a/9aa09af53eeee5a36dfd4f0542cf61ec16c3c168e3b6303b49a7bd5b804b1f56/VERSION    
  226a/9aa09af53eeee5a36dfd4f0542cf61ec16c3c168e3b6303b49a7bd5b804b1f56/layer.tar
  226a/e617952427002a05bebf16ba89b0bcaf93a91c786171a6bebedae828ccce7c48
  226a/e617952427002a05bebf16ba89b0bcaf93a91c786171a6bebedae828ccce7c48/json
  226a/e617952427002a05bebf16ba89b0bcaf93a91c786171a6bebedae828ccce7c48/VERSION
  226a/e617952427002a05bebf16ba89b0bcaf93a91c786171a6bebedae828ccce7c48/layer.tar
  226a/dddd9e457da7e4ad86d2f6323541bfd439cf290716416a40a9fb4944ecee5c87
  226a/dddd9e457da7e4ad86d2f6323541bfd439cf290716416a40a9fb4944ecee5c87/json
  226a/dddd9e457da7e4ad86d2f6323541bfd439cf290716416a40a9fb4944ecee5c87/VERSION  226a/dddd9e457da7e4ad86d2f6323541bfd439cf290716416a40a9fb4944ecee5c87/layer.tar
  </code></pre>
  
  <p>I also tried to take a look directly into <code>/var/lib/docker</code> directory, but did not find anything.</p>
  
  <hr>
  
  <p>So I started back from "scratch", with a very simple example:</p>
  
  <pre><code>[lgmasapp203 ~]$ docker run centos touch xxx
  [lgmasapp203 ~]$ docker ps -n 1
  CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
  b43b9b84172f        centos:7            "touch xxx"         7 seconds ago       Exited (0) 5 seconds ago                       backstabbing_hoover
  [lgmasapp203 ~]$ docker commit b43b xxx
  4b0ed5d4fd1a09e062a02b7066b83115d73a1811863c597f6c5bda01a90507f4
  
  [lgmasapp203 ~]$ docker run xxx ls -l xxx
  -rw-r--r-- 1 root root 0 Jul  2 14:31 xxx
  </code></pre>
  
  <p>Everything looks fine, but:</p>
  
  <pre><code>[lgmasapp203 docker]# find /var/lib/docker/graph/4b0ed5d4fd1a09e062a02b7066b83115d73a1811863c597f6c5bda01a90507f4/
  /var/lib/docker/graph/4b0ed5d4fd1a09e062a02b7066b83115d73a1811863c597f6c5bda01a90507f4/
  /var/lib/docker/graph/4b0ed5d4fd1a09e062a02b7066b83115d73a1811863c597f6c5bda01a90507f4/layersize
  /var/lib/docker/graph/4b0ed5d4fd1a09e062a02b7066b83115d73a1811863c597f6c5bda01a90507f4/json
  </code></pre>
  
  <p>An I did <em>not</em> find anything related to "layer" (as mentionned <a href="http://blog.thoward37.me/articles/where-are-docker-images-stored/" rel="nofollow">here</a>). I do not understand why?</p>
  
  <p>Furthermore:</p>
  
  <pre><code>[lgmasapp203 docker]# find /var/lib/docker/ | grep xxx
  [lgmasapp203 docker]#
  </code></pre>
  
  <p>So where did my file <code>xxx</code> go?</p>
  
  <p>It appears to me that this would be a "basic" feature... and then I'm surprised this has not been addressed already...</p>
  
  <p>Does that mean that I have to rely on the "comment" section of the json??? That would be seriously astonishing :-/</p>
  
  <p>I know that is a lot of questions ;-)<br>
  Thanxs in advance for any enlightment</p>
  
  <p>Christophe</p>