LXC Format (meta) compared to the OCI Image Format

Hi, my first post as I’m very interested to use LXC instead of Docker rather sooner then later.
I would start testing as soon as LXC 3.0 will be available on Alpine Linux.

But I have the following question ahead.
How does the LXC Format compares to the OCI Image Format?
As I see they both use the rootfs in the same way.
So the only differ with the meta, right?

The real question I have to you guys.
If I’ll build OCI images at my build steps,
does that bring any disadvantages or limitations on using them with LXC?
Or in opposite does building the LXC Format directly bring any advantages?

If it will be the same, of course I would prefer the OCI image,
as it would be much more versatile on trying other runtimes anytime in future.

Hope to get an answer, and my English is good enough.
All the best, Chris

If I’ll build OCI images at my build steps,
does that bring any disadvantages or limitations on using them with LXC?

Not really. You can build OCI images and then use the tooling around it to create a rootfs. We also have an oci template that let’s you download and runn those images:

lxc-create c1 -t oci -- --url docker://alpine
lxc-execute c1

From the top of my hat I’m not sure whether the oci template directly supports locally built images with its --url argument. @hallyn, might know though. :slight_smile:

Thanks.
Of course I’m already planning to use the lxc-oci template to convert the OCI image to then run it on LXC.

I’m quite sure it already supports locally stored oci templates as the lxc-oci template is using skopeo.
Should be possible if I store the images in a directory compliant to the “Open Container Image Layout Specification” as described here - Skopeo.
And more in detail here - Image Spec.

lxc-create c1 -t oci -- --url oci:path:tag

But I will see soon if I’m right.
Keep going your great work on LXC. :star_struck:

1 Like

Yup, the --url is in skopeo format, so you can do

lxc-create c1 -t oci -- --url oci:oci:alpine

To use an oci image called ‘alpine’ in the local OCI layout (directory) ‘oci’.

1 Like