kiwi.container Package

Submodules

kiwi.container.docker Module

class kiwi.container.docker.ContainerImageDocker(root_dir, custom_args=None)[source]

Bases: kiwi.container.oci.ContainerImageOCI

Create docker container from a root directory

pack_image_to_file(filename)[source]

Packs the given oci image into the given filename.

Parameters:filename (string) – file name of the resulting packed image

kiwi.container.oci Module

class kiwi.container.oci.ContainerImageOCI(root_dir, custom_args=None)[source]

Bases: object

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_tags’: [‘current’, ‘foobar’],
        ‘entry_command’: [
            ‘–config.entrypoint=/bin/bash’,
            ‘–config.entrypoint=-x’
        ],
        ‘entry_subcommand’: [
            ‘–config.cmd=ls’,
            ‘–config.cmd=-l’
        ],
        ‘maintainer’: [‘–author=tux’],
        ‘user’: [‘–config.user=root’],
        ‘workingdir’: [‘–config.workingdir=/root’],
        ‘expose_ports’: [
            ‘–config.exposedports=80’,
            ‘–config.exposedports=42’
        ],
        ‘volumes’: [
            ‘–config.volume=/var/log’,
            ‘–config.volume=/tmp’
        ],
        ‘environment’: [‘–config.env=PATH=/bin’],
        ‘labels’: [‘–config.label=name=value’]
    }
    
create(filename, base_image)[source]

Create compressed oci system container tar archive

Parameters:
  • filename (string) – archive file name
  • base_image (string) – archive used as a base image
pack_image_to_file(filename)[source]

Packs the oci image into the given filename.

Parameters:filename (string) – file name of the resulting packed image

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