title: undo apt-get update (in docker container)
body: <p>i'm working with docker and want to create a minimal new layer by installing an application in a zip-file on top of an ubuntu image. The ubuntu image has neither wget nor unzip installed, so i install those by using apt-get which requires an <code>apt-get update</code> first</p>
  
  <pre><code>docker run -it --name app_container ubuntu:latest
  # now i have terminal access to the fresh app_container
  
  # install wget and unzip
  apt-get update
  apt-get install wget -y
  apt-get install unzip -y
  
  # download and unpack the app
  # ...
  
  # remove wget and unzip
  apt-get purge unzip
  apt-get purge wget
  # i need to remove some dependencies of wget that are no longer needed
  apt-get autoremove
  </code></pre>
  
  <p>at this point it would be nice if the only content of the new docker layer would be the new application, but there are still the files created/updated by <code>apt-get update</code>. I tried to remove those by using</p>
  
  <pre><code>apt-get clean
  </code></pre>
  
  <p>but a </p>
  
  <pre><code>docker diff app_container
  </code></pre>
  
  <p>revealed that there where lots of changed files left (that didn't belong to the app). Ok, so those are negligible in size (mainly some residual wget certificates in <code>/etc/ssl</code> and <code>/var/lib/dpkg/info</code> and 23MB of archive files in <code>/var/lib/app/lists</code>) but in the spirit of the cleanest possible docker layer: Is there a smart way to remove those, too? ('smart' meaning without resorting to brute-force rm)</p>