| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The binary needs a few more arguments: the path to the firecracker
binary, the path to a linux kernel.
Using the image that was generated, we can now boot the VM with
firecracker. This will rely on a CNI configuration to create the
network, and will use the provided kernel to boot.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We create a loop device by pre-allocating space to a file on disk. This
file is then converted to an ext4 partition, which we mount to a
temporary path on the host.
Once this is done, we extract all the layers from the given container on
that mounted path. We also add a few extra files to the image
(`/etc/hosts` and `/etc/resolv.conf`).
When we're done extracting and writing, we run resize2fs in order to
resize the image to a more reasonable size.
|
|
Pull an image provided as an argument to the program. We're only
interested in images for Linux/amd64 at the moment.
We setup a default namespace for containerd named `c2vm`. Images that
will be pulled by containerd will be stored inside that namespace.
Once the program is build it can be run like this:
```
; sudo ./c2vm -container docker.io/library/redis:latest
pulled docker.io/library/redis:latest (38667897 bytes)
```
And the image is indeed in the namespace:
```
; sudo ctr -n c2vm images ls -q
docker.io/library/redis:latest
```
|