detect if inside Docker container

There's a set of users who may be using certain versions of docker and are switching on these values returning LXC who would be broken by this (presuming they exist).

Do we know if previous to Docker 0.9, when Docker used LXC, if it said docker or lxc here? What about Docker 0.9+ with libcontainer? I'd like to see a unit test for each case that makes it clear what happens in those cases.

@atomic-penguin, any thoughts on this ?