Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker_image_puller.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@ def download_layers(
img: str,
tag: str,
arch: str,
output_dir: Path
output_dir: Path,
workers: int
):
global progress_display
progress_display = ProgressDisplay()
Expand Down Expand Up @@ -915,7 +916,7 @@ def download_layers(

progress_display.print_initial()

num_workers = min(len(layers_to_download), 4) if layers_to_download else 1
num_workers = min(len(layers_to_download), max(1, workers)) if layers_to_download else 1

with ThreadPoolExecutor(max_workers=num_workers) as executor:
futures = {}
Expand Down Expand Up @@ -1227,7 +1228,7 @@ def main():
session, image_info.registry, image_info.repository,
resp_json['layers'], auth_head, imgdir, resp_json,
imgparts, image_info.image_name, image_info.tag, args.arch,
output_dir
output_dir, args.workers
)

output_file = create_image_tar(imgdir, image_info.repository, image_info.tag, args.arch, output_dir)
Expand Down