(
    ctx: click.Context,
    archive: str,
)
scan a docker archive <ARCHIVE> without attempting to save or pull the image.

    Hidden command `ggshield scan docker-archive`
scan a docker archive <ARCHIVE> without attempting to save or pull the image.
scan a docker archive <ARCHIVE > without attempting to save or pull the image .
def docker_archive_cmd(
    ctx: click.Context,
    archive: str,
) -> int:  # pragma: no cover
    """
    scan a docker archive <ARCHIVE> without attempting to save or pull the image.

    Hidden command `ggshield scan docker-archive`
    """
    config = ctx.obj["config"]
    output_handler: OutputHandler = ctx.obj["output_handler"]

    try:
        scan = docker_scan_archive(
            archive=archive,
            client=ctx.obj["client"],
            cache=ctx.obj["cache"],
            verbose=config.verbose,
            matches_ignore=config.matches_ignore,
            all_policies=config.all_policies,
            scan_id=archive,
            banlisted_detectors=config.banlisted_detectors,
        )

        return output_handler.process_scan(scan)
    except Exception as error:
        return handle_exception(error, config.verbose)
def docker_archive_cmd ( ctx : click . Context , archive : str , ) -> int : # pragma: no cover config = ctx . obj [ "config" ] output_handler : OutputHandler = ctx . obj [ "output_handler" ] try : scan = docker_scan_archive ( archive = archive , client = ctx . obj [ "client" ] , cache = ctx . obj [ "cache" ] , verbose = config . verbose , matches_ignore = config . matches_ignore , all_policies = config . all_policies , scan_id = archive , banlisted_detectors = config . banlisted_detectors , ) return output_handler . process_scan ( scan ) except Exception as error : return handle_exception ( error , config . verbose )