Backend - Docker

class conu.DockerBackend(logging_level=20, logging_kwargs=None, cleanup=None)

Bases: Backend

For more info on using the Backend classes, see documentation of the parent conu.apidefs.backend.Backend class.

ContainerClass

alias of DockerContainer

ImageClass

alias of DockerImage

__init__(logging_level=20, logging_kwargs=None, cleanup=None)

This method serves as a configuration interface for conu.

Parameters:
  • logging_level – int, control logger verbosity: see logging.{DEBUG,INFO,ERROR}

  • logging_kwargs – dict, additional keyword arguments for logger set up, for more info see docstring of set_logging function

  • cleanup – list, list of cleanup policy values, examples: - [CleanupPolicy.EVERYTHING] - [CleanupPolicy.VOLUMES, CleanupPolicy.TMP_DIRS] - [CleanupPolicy.NOTHING]

cleanup_containers()

Remove containers associated with this backend instance

Returns:

None

cleanup_images()

Remove images associated with this backend instance

Returns:

None

cleanup_volumes()

Remove volumes associated with this backend instance

Returns:

None

list_containers()

List all available docker containers.

Container objects returned from this methods will contain a limited amount of metadata in property short_metadata. These are just a subset of .inspect(), but don’t require an API call against dockerd.

Returns:

collection of instances of conu.DockerContainer

list_images()

List all available docker images.

Image objects returned from this methods will contain a limited amount of metadata in property short_metadata. These are just a subset of .inspect(), but don’t require an API call against dockerd.

Returns:

collection of instances of conu.DockerImage

login(username, password=None, email=None, registry=None, reauth=False, dockercfg_path=None)
Parameters:
  • username – The registry username

  • password – The plaintext password

  • email – The email for the registry account

  • registry – URL to the registry, example: - https://index.docker.io/v1/

  • reauth – Whether or not to refresh existing authentication on the Docker server.

  • dockercfg_path – Use a custom path for the Docker config file

Returns:

None