dotcloud/docker — pull request #1883 by tianon (2013-09-14 00:44:10+00:00)
Title: Several small tweaks/fixes for contrib/mkimage-debian.sh

I decided it was time to workaround #1755 in the mkimage-debian.sh script, so I figured out a simple fix. Now we just let `docker import` tag the image directly, and we don't care about the actual image hash, since `docker tag` lets us use `repo:tag` in place of the image hash to just tag an existing tag elsewhere, and that works swell for our purposes here.

While I was there (and since @shykes and I were discussing it on IRC), I added the /usr/sbin/policy-rc.d mentioned in #446 by default, since the vast majority of docker users are surprised when they `apt-get install` or `apt-get upgrade` and services fail to start and that sometimes makes the install fail. Users who specifically run with /sbin/init can then delete that file, instead of the rest of us having to add it, which makes a lot of sense.

Finally, I also added `apt-get clean` right before we import so that we get smaller images (since the basic idea of this script is to create base images), and on wheezy I went from ~157.5MB down to ~120MB, which I think is a worthwhile decrease.

cc @KSid