Sunday 16 August 2015

Docker on Windows 10

So on the docker site it says that windows 10 is not supported(link), however you can still get it to run, you just need a few apps/settings first.

Software

Virtual box test build
(https://www.virtualbox.org/wiki/Testbuilds)
Virtual box expansion pack (http://download.virtualbox.org/virtualbox/5.0.2/Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096.vbox-extpack)
Docker Tool box
(https://www.docker.com/toolbox)

Install process
> Install the latest VirtualBox (I used 5.0.x revision 102010)
> Install the expansion pack for VirtualBox
> Install Docker Tool box, ensuring to un-check the install VirtualBox option (you already installed the win 10 working one)

Then just run the 'Kitematic (Alpha)' (more on why not to use 'Docker Quickstart Terminal' later). If the Kitematic app reports it can't connect to the VM then more likely than not the docker VM did not start as it should have (this happened to me).

If so open VirtualBox and double click on the 'default' docker VM to bring up the management frame for it, more likely than not you will get an error about like  "VT-x/AMD-V hardware acceleration is not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it."

This happens when VirtualBox can't use the hardware virtualization capabilities of the host system, most systems have either VT-x or AMD-V, you can check this by looking on the 'performance' tab of the task manager if you see 'enabled' next to you have the needed hardware.



In my case it was Microsoft Hyper-V that was holding on to the VT-x resource so I un-installed the Hyper-V platform module from my system, rebooted then VirtualBox worked fine with full VT-x functions available.



Further info regarding how to setup a shell (ps or cmd) to interact with docker can be found here or you can just run 'Kitematic (Alpha)' and then have it spawn a configured powershell interface for you, it can even spin-up the VM for you as well and I recommend you do created the VM via Kitematic as it seems to do a better job at sorting out connection certs then the 'Docker Quickstart Terminal'

Finally what how-to document would be complete without a 'proof of working state' image so here you go



Sunday 12 April 2015

ComputerCraft - lua tables

So recently I started looking into ComputerCraft (a Minecraft mod) and thus had to start learning lua code.

The first problem I came across was with tables, more specifically inserting extra values into them.
 eg
local caches = {}

caches.insert(caches,v)

where v was a value from a loop I had the program iterating through

however I kept getting the error  "attempt to call nil"

so.. what was I doing wrong?

The example was basing the code off was

local Table = {"One"}
table.insert(Table, "Three")

things learned were

1> Instantiated variables do not take on the properties of their type (un-like some other languages)
2> lua is fully case sensitive throughout

so the solution to all the problems was ... that 'table' was a base function, not an instantiated variable having a function of insert()

so changing ' caches.insert(caches,v) ' to 'table.insert(caches,v)' fixed the problem