Hacker News new | ask | show | jobs
by zhemao 4696 days ago
Haha, I had a good laugh upon hearing that Docker cannot run inside of itself. Is this an LXC limitation? Clearly the solution was to run Docker inside of KVM inside of Docker.

But seriously, nice job. I haven't used docker yet because I want to play around with the standard lxc utilities first. But this is pretty awesome.

3 comments

It's not an LXC limitation, but seeing as this case hasn't gotten the love it involves jimmying things all over the place.

https://github.com/dotcloud/docker/wiki/Docker-in-Docker

Thank you for posting this answer. Indeed, I think the short answer is: It is not impossible, but there are limitations.
Actually, I've ran Docker within QEMU within Docker (using v9fs so that QEMU could use the container's FS as root FS). Works, but painfully slow and not very resource-efficient :-)
I will add that Docker is getting an architecture upgrade, and in the future will support nesting :)
Yeah, I was kidding about Docker in KVM in Docker. I know it would be a lot of overhead.
Would there be a useful reason to actually do this (run Docker in Docker), or is it more just a novelty?
If anything, it's needed for the development of docker itself. We already build docker with docker (https://github.com/dotcloud/docker/blob/master/Dockerfile), but we can't yet test docker with docker because of the nesting problem.
I'd like to give each tenant a container and let them run Docker app containers within that.