def remove_container(config, container=None, force=True, v=False, *args, **kwargs):
    '''
    Removes a container from a docker installation

    container
        Container id to remove
    force
        By default, remove a running container, set this
        to notremove it unconditionally
    v
        verbose mode

    Return boolean
    '''
    err = "Unknown"
    client = _get_client(config)
    dcontainer = None
    try:
        try:
            dcontainer = _get_container_infos(config, container)['Id']
        except Exception:
#            print "Container not existing."
            return True
        else:
            if not dcontainer:
                return True
            if is_running(config, dcontainer):
                if not force:
                    utils.error("Container running, won't remove it.")
                    return False
                else:
                    kill(config, dcontainer)
            client.remove_container(dcontainer, v=v)
            try:
                infos = _get_container_infos(config, dcontainer)
                if not infos:
                    return True
            except Exception:
#                print "Container has been successfully removed."
                return True
    except Exception as e:
        err = e
    utils.error("Unable to remove container: %s"%err)
    return False
def remove_container ( config , container = None , force = True , v = False , * args , ** kwargs ) : err = "Unknown" client = _get_client ( config ) dcontainer = None try : try : dcontainer = _get_container_infos ( config , container ) [ 'Id' ] except Exception : return True else : if not dcontainer : return True if is_running ( config , dcontainer ) : if not force : utils . error ( "Container running, won't remove it." ) return False else : kill ( config , dcontainer ) client . remove_container ( dcontainer , v = v ) try : infos = _get_container_infos ( config , dcontainer ) if not infos : return True except Exception : return True except Exception as e : err = e utils . error ( "Unable to remove container: %s" % err ) return False
Removes a container from a docker installation

    container
        Container id to remove
    force
        By default, remove a running container, set this
        to notremove it unconditionally
    v
        verbose mode

    Return boolean