Skip to content

kwizart/image-builder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online Labs - Image Builder

Scripts used to build the official images on http://labs.online.net/

Examples

Build a tarball of ubuntu-trusty

cd images/ubuntu-trusty
./build tarball

Build a disk image of debian-wheezy

  • Be sure to have a /dev/nbd1 device attached (WARNING, everything will be deleted)
  • Run: cd images/debian-wheezy; ./build image /dev/nbd1
  • If everything is OK, run sync; halt
  • Powerof your server from the console
  • Create a snapshot of /dev/nbd1
  • Try to boot from your snapshot or create a new image from your snapshot

Develop a new image

  • Copy the closest existing image
  • Adapt things you are sure
  • Run a first DEBUG=1 ./build image
  • If you have errors, you need to investigate and fix your script
  • If you just want to give a try or do some checks before, the working directory is mounted in rootfs-target, you can inspect, chroot, etc

Image check list

List of features, scripts and modifications to check for proper labs.online.net image creation.

  • Add sysctl entry vm.min_free_kbytes=65536
  • Configure NTP to use internal server.
  • Configure SSH to only accept login through public keys and deny environment customization to avoid errors due to users locale.
  • Configure default locale to en_US.UTF-8.
  • Configure network scripts to use DHCP and enable them. Although not, strictly speaking, needed since kernel already has IP address and gateway this allows DHCP hooks to be called for setting hostname, etc.
  • Install custom DHCP hook for hostname to set entry in /etc/hosts for software using getent_r to get hostname.
  • Install scripts to fetch SSH keys
  • Install scripts to fetch kernel modules.
  • Install scripts to connect and/or mount NBD volumes.
  • Install scripts to manage NBD root volume.
  • Disable all physical TTY initialization.
  • Enable STTY @ 9600 bps.

Before making the image public, do not forget to check it boots, stops and restarts from the OS without any error (most notably kernel) since a failure could lead to deadlocked instances.

Packages

No packages published

Languages

  • Shell 66.3%
  • JavaScript 28.8%
  • PHP 4.9%