github.com/inspektor-gadget/inspektor-gadget@v0.28.1/docs/reference/oci.md (about)

     1  ---
     2  title: 'Gadgets as OCI artifacts'
     3  weight: 20
     4  description: 'Reference documentation for the format of a gadget OCI artifact'
     5  ---
     6  
     7  Intro TODO
     8  
     9  ## Specifications
    10  
    11  The [Open Container Initiative](https://opencontainers.org/) defines the [Image
    12  Format
    13  Specification](https://github.com/opencontainers/image-spec/blob/main/spec.md).
    14  This specification was initially defined for container images but it is
    15  extended to store other artifacts, see [Guidance for Artifacts
    16  Authors](https://github.com/opencontainers/image-spec/blob/main/artifacts-guidance.md).
    17  
    18  ## Architectures
    19  
    20  Inspektor Gadget supports multi architecture artifacts. The following
    21  architectures are supported:
    22  
    23  - amd64
    24  - arm64
    25  
    26  ## Gadget metadata
    27  
    28  Media type: `application/vnd.gadget.config.v1+yaml`
    29  
    30  The content has the type [GadgetMetadata
    31  struct](https://github.com/inspektor-gadget/inspektor-gadget/blob/7d12644a89217bdbf861da54cd8bd2a370754ece/pkg/gadgets/run/types/metadata.go#L136).
    32  It is a work in progress.
    33  
    34  ## Image layers and media types
    35  
    36  Each architecture can contain several layers, but each layer must have a
    37  different media type among the following:
    38  
    39  - `application/vnd.gadget.ebpf.program.v1+binary`
    40  - `application/vnd.gadget.wasm.program.v1+binary`
    41  - `application/vnd.gadget.btfgen.v1+binary`
    42  
    43  ### The ebpf layer
    44  
    45  There must be exactly one layer with the ebpf media type. It must not be empty.
    46  Its content must be a valid ELF file.
    47  
    48  ### The wasm layer
    49  
    50  There must be at most one layer with the wasm media type. If present, it must
    51  not be empty and it must be a valid wasm file.
    52  
    53  ### The btfgen layer
    54  
    55  [btfgen](https://www.inspektor-gadget.io//blog/2022/03/btfgen-one-step-closer-to-truly-portable-ebpf-programs/)
    56  is used to enable running eBPF programs on kernels that don't provide BTF information. A gadget
    57  image can contain at most one btfgen layer. This layer must contain the generated BTF files in a
    58  tarball following the same folder structure of
    59  [btfhub-archive](https://github.com/aquasecurity/btfhub-archive/).
    60  
    61  ## Image annotations
    62  
    63  OCI images can have annotations at different levels:
    64  - index
    65  - manifest
    66  - config
    67  - layer
    68  
    69  Inspektor Gadget automatically adds the following annotations at the manifest and config levels:
    70  - `org.opencontainers.image.*`: defined by [OCI Image Format](https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys)
    71    - title
    72    - description
    73    - url
    74    - documentation
    75    - source
    76    - created