def METHOD_NAME(container, path, target_path, size=None):
    with open(path, "rb") as fd:
        tario = BytesIO()
        tar = tarfile.TarFile(fileobj=tario, mode="w")
        info = tarfile.TarInfo(name=target_path)
        if size is None:
            size = os.fstat(fd.fileno()).st_size
        info.size = size
        tar.addfile(info, fd)
        tar.close()
        container.put_archive("/", tario.getvalue())
        time.sleep(2)