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 usernamepassword (
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. ubuntutag (
str
) – (optional) The image tag (defaults to latest)namespace (
str
) – (optional) The docker namespace
- Returns
A container image
- Return type
- 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 namespacemax_count (
int
) – The maximum number of records to return
- Returns
A list of images
- Return type
- 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 usernamepassword (
str
) – (optional) Your hub account password