(
    paths: Mapping[Path, str], container: "Container", destination_path: PurePath
)
Copy local ``paths`` to ``destination_path`` within ``container``.

    The ``container`` is assumed to be running.
    If ``destination_path`` does not exist, it will be created.
Copy local ``paths`` to ``destination_path`` within ``container``.
Copy local paths to destination_path within container .
def copy_into_container(
    paths: Mapping[Path, str], container: "Container", destination_path: PurePath
) -> None:
    """Copy local ``paths`` to ``destination_path`` within ``container``.

    The ``container`` is assumed to be running.
    If ``destination_path`` does not exist, it will be created.
    """
    tar_buffer = BytesIO()
    with tarfile.open(mode="w", fileobj=tar_buffer) as archive:
        for p, loc in paths.items():
            archive.add(str(p), arcname=loc)
    tar_buffer.seek(0)
    tar_bytes = tar_buffer.read()

    logging.info(f"sending {len(tar_bytes)} bytes to {container}")
    container.put_archive(str(destination_path), tar_bytes)
def copy_into_container ( paths : Mapping [ Path , str ] , container : "Container" , destination_path : PurePath ) -> None : tar_buffer = BytesIO ( ) with tarfile . open ( mode = "w" , fileobj = tar_buffer ) as archive : for p , loc in paths . items ( ) : archive . add ( str ( p ) , arcname = loc ) tar_buffer . seek ( 0 ) tar_bytes = tar_buffer . read ( ) logging . info ( f"sending {len(tar_bytes)} bytes to {container}" ) container . put_archive ( str ( destination_path ) , tar_bytes )