(image_name: str)
Pull docker image and raise exception on timeout or failed to find image
Pull docker image and raise exception on timeout or failed to find image
Pull docker image and raise exception on timeout or failed to find image
def docker_pull_image(image_name: str) -> None:
    """
    Pull docker image and raise exception on timeout or failed to find image
    """
    command = ["docker", "pull", image_name]
    try:
        subprocess.run(
            command,
            check=True,
            timeout=DOCKER_COMMAND_TIMEOUT,
        )
    except subprocess.CalledProcessError:
        raise click.ClickException(f'Image "{image_name}" not found')
    except subprocess.TimeoutExpired:
        raise click.ClickException('Command "{}" timed out'.format(" ".join(command)))
def docker_pull_image ( image_name : str ) -> None : command = [ "docker" , "pull" , image_name ] try : subprocess . run ( command , check = True , timeout = DOCKER_COMMAND_TIMEOUT , ) except subprocess . CalledProcessError : raise click . ClickException ( f'Image "{image_name}" not found' ) except subprocess . TimeoutExpired : raise click . ClickException ( 'Command "{}" timed out' . format ( " " . join ( command ) ) )