kiwi.container Package

Submodules

kiwi.container.oci Module

class kiwi.container.oci.ContainerImageOCI(root_dir: str, transport: str, custom_args: OciConfig | None = None)[source]

Bases: ContainerImageBase

Create oci container from a root directory

Parameters:
  • root_dir (string) – root directory path name

  • custom_args (dict)

Custom processing arguments defined as hash keys:

Example

{
    'container_name': 'name',
    'container_tag': '1.0',
    'additional_names': ['current', 'foobar'],
    'entry_command': ['/bin/bash', '-x'],
    'entry_subcommand': ['ls', '-l'],
    'maintainer': 'tux',
    'user': 'root',
    'workingdir': '/root',
    'expose_ports': ['80', '42'],
    'volumes': ['/var/log', '/tmp'],
    'environment': {'PATH': '/bin'},
    'labels': {'name': 'value'},
    'history': {
        'created_by': 'some explanation here',
        'comment': 'some comment here',
        'author': 'tux'
    }
}
create(filename: str, base_image: str, ensure_empty_tmpdirs: bool = True, compress_archive: bool = False) str[source]

Create compressed oci system container tar archive

Parameters:
  • filename (string) – archive file name

  • base_image (string) – archive used as a base image

  • ensure_empty_tmpdirs (bool) – exclude system tmp directories

  • compress_archive (bool) – compress container archive

class kiwi.container.oci.OciConfig[source]

Bases: TypedDict

additional_names: List[str]
container_name: str
container_tag: str
entry_command: List[str]
entry_subcommand: List[str]
environment: Dict[str, str]
expose_ports: List[str]
history: Dict[str, str]
labels: Dict[str, str]
maintainer: str
user: str
volumes: List[str]
workingdir: str

Module Contents

class kiwi.container.ContainerImage[source]

Bases: object

Container Image factory

Parameters:
  • name (string) – container system name

  • root_dir (string) – root directory path name

  • custom_args (dict) – custom arguments

static new(name: str, root_dir: str, custom_args: Dict | None = None) ContainerImageBase[source]