Back to Buildkit

Overlaybd

docs/overlaybd.md

0.29.02.2 KB
Original Source

Overlaybd

Overlaybd is a novel layering block-level image format, which is design for container, secure container and applicable to virtual machine. And it is an open-source implementation of paper DADI: Block-Level Image Service for Agile and Elastic Application Deployment. USENIX ATC'20".

Build Overlaybd Images

Before building overlaybd images, ensure that overlaybd-tcmu and overlaybd-snapshotter are active by referring to the QUICKSTART guide.

To use buildkit to build overlaybd images, you should specify --oci-worker-snapshotter=overlaybd and --oci-worker-proxy-snapshotter-path=/run/overlaybd-snapshotter/overlaybd.sock when start buildkitd:

bash
buildkitd  --oci-worker-snapshotter=overlaybd  --oci-worker-proxy-snapshotter-path=/run/overlaybd-snapshotter/overlaybd.sock

If an overlaybd image is used in the FROM instruction of a Dockerfile, the build will produce a new overlaybd image. It is essential to include --oci-mediatypes=true and --compression=uncompressed while running buildctl:

bash
buildctl build ... \
--output type=image,name=<new image name>,push=true,oci-mediatypes=true,compression=uncompressed

Performance

In our test case Dockerfile, we used a 5GB OCI image (and corresponding overlaybd format), wrote some new layers of identical size, and recorded the time cost of image pull (as pull in the table below), building all lines in Dockerfile (as build), and exporting to image and pushing (as push).

OCI:

size per layerlayerspullbuildpushtotal
4GB1105.723.5219.4348.6
1GB488.534.0123.8246.3
256MB1092.120.763.6176.4

Overlaybd:

size per layerlayerspullbuildpushtotal
4GB10.921.5166.2188.6
1GB40.924.972.998.7
256MB100.718.448.968.0