Container Utility API

class libcloud.container.utils.docker.RegistryClient(host, username=None, password=None, **kwargs)[source]

A client for the Docker v2 registry API

Construct a Docker registry client

Parameters
  • host (str) – Your registry endpoint, e.g. ‘registry.hub.docker.com’

  • username (str) – (optional) Your registry account username

  • password (str) – (optional) Your registry account password

connectionCls

alias of libcloud.container.utils.docker.DockerHubConnection

get_image(repository_name, tag='latest', namespace='library')[source]

Get an image from a repository with a specific tag

Parameters
  • repository_name (str) – The name of the repository, e.g. ubuntu

  • tag (str) – (optional) The image tag (defaults to latest)

  • namespace (str) – (optional) The docker namespace

Returns

A container image

Return type

libcloud.container.base.ContainerImage

get_repository(repository_name, namespace='library')[source]

Get the information about a specific repository

Parameters
  • repository_name (str) – The name of the repository e.g. ‘ubuntu’

  • namespace (str) – (optional) The docker namespace

Returns

The details of the repository

Return type

object

list_images(repository_name, namespace='library', max_count=100)[source]

List the tags (versions) in a repository

Parameters
  • repository_name (str) – The name of the repository e.g. ‘ubuntu’

  • namespace (str) – (optional) The docker namespace

  • max_count (int) – The maximum number of records to return

Returns

A list of images

Return type

list of libcloud.container.base.ContainerImage

class libcloud.container.utils.docker.HubClient(username=None, password=None, **kwargs)[source]

A client for the Docker Hub API

The hub is based on the v2 registry API

Construct a Docker hub client

Parameters
  • username (str) – (optional) Your Hub account username

  • password (str) – (optional) Your hub account password