Skip to content

Instantly share code, notes, and snippets.

@colinsurprenant
Created November 27, 2013 21:06
Show Gist options
  • Save colinsurprenant/7683187 to your computer and use it in GitHub Desktop.
Save colinsurprenant/7683187 to your computer and use it in GitHub Desktop.
Docker Ubuntu raring 13.04 image creation
sudo debootstrap raring raring > /dev/null
cd raring
# prevent init scripts from running during install/update
echo $'#!/bin/sh\nexit 101' | sudo tee usr/sbin/policy-rc.d > /dev/null
# see https://github.com/dotcloud/docker/issues/446#issuecomment-16953173
sudo chmod +x usr/sbin/policy-rc.d
# shrink the image
sudo chroot . apt-get clean
# forces dpkg not to call sync() after package extraction and speeds up install
echo 'force-unsafe-io' | sudo tee etc/dpkg/dpkg.cfg.d/02apt-speedup > /dev/null
# we don't need an apt cache in a container
echo 'Acquire::http {No-Cache=True;};' | sudo tee etc/apt/apt.conf.d/no-cache > /dev/null
sudo tar -c . | sudo docker import - ubuntu-raring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment