def push(repo, tag=None, quiet=False, insecure_registry=False):
    client = _get_client()
    status = base_status.copy()
    registry, repo_name = docker.auth.resolve_repository_name(repo)
    try:
        kwargs = {'tag': tag}
        # if docker-py version is greater than 0.5.0 use the
        # insecure_registry parameter
        if salt.utils.compare_versions(ver1=docker.__version__,
                                       oper='>=',
                                       ver2='0.5.0'):
            kwargs['insecure_registry'] = insecure_registry
        ret = client.push(repo, **kwargs)
        if ret:
            image_logs, infos = _parse_image_multilogs_string(ret)
            if image_logs:
                repotag = repo_name
                if tag:
                    repotag = '{0}:{1}'.format(repo, tag)
                if not quiet:
                    status['out'] = image_logs
                else:
                    status['out'] = None
                laststatus = image_logs[2].get('status', None)
                if laststatus and (
                    ('already pushed' in laststatus)
                    or ('Pushing tags for rev' in laststatus)
                    or ('Pushing tag for rev' in laststatus)
                ):
                    status['status'] = True
                    status['id'] = _get_image_infos(repo)['Id']
                    status['comment'] = 'Image {0}({1}) was pushed'.format(
                        repotag, status['id'])
                else:
                    _push_assemble_error_status(status, ret, image_logs)
            else:
                status['out'] = ret
                _push_assemble_error_status(status, ret, image_logs)
        else:
            _invalid(status)
    except Exception:
        _invalid(status, id_=repo, out=traceback.format_exc())
    return status
Pushes an image to any registry. See documentation at top of this page to
dataset/ETHPy150Open saltstack/salt/salt/modules/dockerio.py/push