I'm aware that Snappy Ubuntu can host Docker containers. My question is whether it can also be run inside a container, as a Docker guest.
The reason I'm asking is that I can't find any Snappy VM guest containers in the public Docker repository.
dockerubuntu-corevirtualization
I'm aware that Snappy Ubuntu can host Docker containers. My question is whether it can also be run inside a container, as a Docker guest.
The reason I'm asking is that I can't find any Snappy VM guest containers in the public Docker repository.
Best Answer
Yes, you can: Snappy is just a stripped down version of Ubuntu, and Ubuntu works inside Docker. The fact that Snappy does not appear inside the public Docker repository implies that you have to do things manually.
First, get the latest image:
This file is a QCOW2 image meant for QEMU/KVM, but we can extract its contents for Docker too.
In order to access the files inside a QCOW2 image, you'll need
qemu-nbd
, so install it and run:This command will create a "virtual disk" named
/dev/ndb0
, with "virtual partitions" named/dev/ndb0pX
. Usefdisk -l /dev/nbd0
to get an idea of what partitions are inside the QCOW2 image.The partition you are interested in is
/dev/ndb0p3
, so mount it:You are almost done! Just follow Docker's guide on custom base images:
Now you are ready to create your Snappy images on top of that base image. For example, I created a snappy_test image with the xkcd-webserver app installed. Here's the
Dockerfile
I used: