From a39ae14334c1b612824aadf4b9a6bd09507db369 Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Mon, 7 Oct 2024 12:26:27 -0400 Subject: [PATCH] fix(docker): don't open files in `stream_context_tar` Opening file paths here results in an OSError in Gecko due to the large number of files involved in creating docker images there. The underlying tar writer accepts both file paths or file objects, so switch to paths to avoid the error in Gecko. --- src/taskgraph/util/docker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/taskgraph/util/docker.py b/src/taskgraph/util/docker.py index 9c795104..e362aece 100644 --- a/src/taskgraph/util/docker.py +++ b/src/taskgraph/util/docker.py @@ -149,7 +149,7 @@ def stream_context_tar(topsrcdir, context_dir, out_file, image_name=None, args=N for f in files: source_path = os.path.join(root, f) archive_path = source_path[len(context_dir) + 1 :] - archive_files[archive_path] = open(source_path, "rb") + archive_files[archive_path] = source_path # Parse Dockerfile for special syntax of extra files to include. content = []