Container

    Container API is available in Libcloud 1.0.0-pre1 and higher.

    Note

    Container API is currently in an EXPERIMENTAL state.

    Container API allows users to install and deploy containers onto container based virtualization platforms. This is designed to target both on-premise installations of software like Docker as well as interfacing with Cloud Service Providers that offer Container-as-a-Service APIs.

    For an example of the simple container support, see the Docker example:

    1. cls = get_driver(Provider.DOCKER)
    2. key_file='key.pem', cert_file='cert.pem')
    3. image = driver.install_image('tomcat:8.0')
    4. container = driver.deploy_container('tomcat', image)

    Container-as-a-Service providers will implement the ContainerDriver class to provide functionality for :

    • Listing deployed containers
    • Destroying containers
    • Creating/deploying containers
    • Listing container images
    • Installing container images (pulling an image from a local copy or remote repository)

    Driver base API documentation is found here:

    • - A driver for interfacing to a container provider

    Simple Container Support

    • ContainerImage - Represents an image that can be deployed, like an application or an operating system
    • - Represents a deployed container image running on a container host

    Cluster support extends on the basic driver functions, but where drivers implement the class-level attribute supports_clusters as True clusters may be listed, created and destroyed. When containers are deployed, the target cluster can be specified.

    • ContainerCluster - Represents a deployed container image running on a container host
    • - Represents a location for clusters to be deployed

    Bootstrapping Docker with Compute Drivers

    For a list of supported providers see supported providers page.

    Examples

    We have .

    For a full reference of all the classes and methods exposed by the Container API, see this page.

    Utility Classes

    There are some utility classes for example, a Docker Hub API client for fetching images and iterating through repositories see .