Ability to build docker image
diff --git a/ubuntu-14.04/scripts/base.sh b/ubuntu-14.04/scripts/base.sh
index ddd0d05..c1a7a06 100644
--- a/ubuntu-14.04/scripts/base.sh
+++ b/ubuntu-14.04/scripts/base.sh
@@ -5,21 +5,23 @@
 apt-get update
 
 # Cleanup old kernels, ensure latest is installed via virtual package
-apt-get purge -y linux-image-* linux-headers-*
-apt-get install -y linux-generic-lts-utopic
+if [ ! -f /tmp/no_install_kernel ]; then
+    apt-get purge -y linux-image-* linux-headers-*
+    apt-get install -y linux-generic-lts-utopic
+
+    # Update grub cmdline
+    sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+    sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
+    update-grub
+fi
 
 apt-get -y upgrade
 apt-get -y dist-upgrade
 
 apt-get autoremove --purge
 
-# Update grub cmdline
-sed -i 's|GRUB_CMDLINE_LINUX_DEFAULT=.*|GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
-sed -i 's|GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"|g' /etc/default/grub
-update-grub
-
 # Useful tools
-apt-get -y install curl tmux vim-nox byobu iputils-ping traceroute htop
+apt-get -y install curl wget tmux vim-nox byobu iputils-ping traceroute htop
 
 # Tmux fixes
 cat << 'EOF' >> /etc/tmux.conf
diff --git a/ubuntu-14.04/scripts/docker.sh b/ubuntu-14.04/scripts/docker.sh
new file mode 100644
index 0000000..d773044
--- /dev/null
+++ b/ubuntu-14.04/scripts/docker.sh
@@ -0,0 +1,11 @@
+# This should simulate preseed behavior
+
+apt-get -y install curl
+
+echo "deb [arch=amd64] http://apt.cloudlab.cz/nightly trusty main cloudlab security" >/etc/apt/sources.list
+curl -s http://apt.cloudlab.cz/public.gpg | apt-key add -
+
+apt-get update
+
+# Kernel makes no sense in docker, let base.sh know
+touch /tmp/no_install_kernel
diff --git a/ubuntu-14.04/template.json b/ubuntu-14.04/template.json
index b972468..1677300 100644
--- a/ubuntu-14.04/template.json
+++ b/ubuntu-14.04/template.json
@@ -39,6 +39,14 @@
             "scripts/zerodisk.sh"
           ]
 	},
+	"docker": {
+          "scripts": [
+            "scripts/docker.sh",
+            "scripts/base.sh",
+	    "scripts/salt.sh",
+            "scripts/cleanup.sh"
+          ]
+	},
 	"digitalocean": {
 	  "scripts": [
 	    "scripts/base.sh",
@@ -73,9 +81,17 @@
         },
 	"qemu": {
 	  "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box"
+	},
+	"qemu": {
+	  "output": "images/{{ user `distro` }}-qemu-{{ timestamp }}.box"
 	}
       },
-      "except": [ "digitalocean" ]
+      "except": [ "digitalocean", "docker" ]
+    },
+    {
+      "type": "docker-tag",
+      "repository": "cloudlab/ubuntu",
+      "tag": "14.04"
     }
   ],
   "builders": [
@@ -224,7 +240,12 @@
         "<enter><wait>"
      ]
    },
-    { 
+    {
+      "type": "docker",
+      "image": "ubuntu:14.04",
+      "commit": true
+   },
+    {
       "type": "digitalocean",
       "api_token": "{{user `do_api_token`}}",
       "image": "{{user `distro`}}",