[meta-virtualization] image-oci.bbclass: description of usage of oci image

"Yiding Liu (Fujitsu)" <[email protected]>
Newsgroups org.yoctoproject.lists.meta-virtualization
Message-ID <TY3PR01MB10110B39C744E9FAC050B99299B7FA@TY3PR01MB10110.jpnprd01.prod.outlook.com>
Hi Bruce
    1.  I follow the step of running oci image in  image-oci.bbclass but it has error in runc.

    # tar -xvf container-base-latest-oci-dir.tar                                                                      
                                                                   
    # oci-image-tool create --ref name=latest container-base-qemux86-64.rootfs-20260302090735.rootfs-oci container-base-oci-bundle                                                                        
                                                                      
    # runc run -b container-base-oci-bundle ctr-build                                                                       
ERRO[0000] runc run failed: unable to start container process: error during container init: open /dev/pts/ptmx: no such file or directory                                                                   

  2. Then I follow the comment in image-oci-umoci.inc using two methods which can run container successfully
    # make a tar version of the image direcotry
    #  1) image_name.tar: compatible with oci tar format, blobs and rootfs
    #     are at the top level. Can load directly from something like podman
    #  2)image_name-dir.ta: original format from meta-virt, is just a tar'd
    #     up oci image directory (compatible with skopeo :dir format)

   2.1 Method 1 for image_name.tar
# podman load -i container-base-latest-oci.tar

# podman images | grep localhost/latest
localhost/latest                           latest      1d603a1041c5  14 years ago   5.58 MB

# podman run -it 1d603a1041c5
/ # ls
bin    boot   dev    etc    home   lib    media  mnt    proc   root   run    sbin   sys    tmp    usr    var

    2.2  Method 2 for image_name-dir.tar
# tar xvf container-base-latest-oci-dir.tar
# skopeo copy oci:container-base-qemux86-64.rootfs-20260302090735.rootfs-oci:latest containers-storage:container-base-qemux86-64:1.0
# podman images | grep container-base-qemux86-64
docker.io/library/container-base-qemux86-64  1.0         1d603a1041c5  14 years ago   5.58 MB

# podman run --rm -it 1d603a1041c5
/ # ls
bin    boot   dev    etc    home   lib    media  mnt    proc   root   run    sbin   sys    tmp    usr    var

       Based on this phenomenon, I think we can modify the  description of usage of oci image in image-oci.bbclass to use the  two methods above.

       What do you think about my suggestion?

Liu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.