            # Fakeroot is required to create some character devices that reside in the /var/lib/docker folder.
            subprocess.run(f"fakeroot tar xzf {gzip_with_files_for_integration_tests}",
                           shell=True,
                           check=True,
                           cwd=tmp_path)
        else:
            subprocess.run(f"tar xzf {gzip_with_files_for_integration_tests}",
                           shell=True,
                           check=True,
                           cwd=tmp_path)
        return Path(tmp_path)