Example #1
0
def push(image, registry):
    """
    Push an image or a repository to the given registry, independently from
    its current tag.
    """

    registry = get_host_ui(registry)
    repo = utils.full_name(image, registry=registry)

    if repo != image:
        subprocess.call([DOCKER, 'tag', image, repo])
    subprocess.call([DOCKER, 'push', repo])
Example #2
0
def pull(image, registry):
    """
    Pull an image or a repository from the given registry, independently from
    its tag.
    """

    registry = get_host_ui(registry)
    repo = utils.full_name(image, registry=registry)

    subprocess.call([DOCKER, 'pull', repo])

    if repo != image:
        subprocess.call([DOCKER, 'tag', repo, image])