genvid.toolbox.DockerTool

class genvid.toolbox.DockerTool

Bases: genvid.toolbox.network.NetworkTool

Handle manipulation of docker images archive.

DOCKER_MACHINE_NAME = None

A mirror of DOCKER_MACHINE_NAME, giving the name of the Docker machine

IMAGE_TEMPLATE = '{image}_{version}_{imageid}.{archfmt}'

Template of an image filename. Must match RE_IMAGE_IMAGEID

RE_DIRTY_VERSION = re.compile('^(latest|dev|.*[.+]dirty)$')

Determine if an image version is dirty.

Dirty versions include ‘latest’, ‘dev’, or ending with ‘[.+]dirty’. It force a pull of the image in the job definition.

RE_IMAGE_IMAGEID = re.compile('(?P<image>.+)_(?P<version>[^_]*)_(?P<imageid>[0-9a-f]{12})\\.(?P<archfmt>[^.]*)')

Decompose an image filename into <image>_<version>_<id>.<archfmt>

RE_SUCCESSFUL_BUILD = re.compile('(Successfully built |sha256:)([0-9a-f]+)')

Docker build success message regular expression

build_docker(tag, path=None, rm=True, forcerm=True, **kwargs)

Build a docker image

Returns the image build.

docker

A docker client.

get_image_path(image, version, imageid, archfmt='docker')
get_images()
get_images_config(baseurl)
get_latest_images()
set_docker_env()

Setup the Docker environment using Docker machine.

update_image(image, version='latest', clean=False)

Update the image archive.

static version_to_imagetag(image, version)

Return a tag suitable for docker

class docker.DockerTool

Implementation of genvid.toolbox.DockerTool