From c4f54c6aa38fdf2d4ee28e7a32d600b3166e77d7 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Wed, 11 Mar 2020 21:55:53 +0000 Subject: [PATCH] Run each build using `docker exec`, for faster builds --- cibuildwheel/linux.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 8af63e12..fec6da5d 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -100,11 +100,13 @@ def build(project_dir, output_dir, test_command, before_test, test_requires, tes '--name', container_name, '-i', '-v', '/:/host', # ignored on CircleCI - docker_image, '/bin/bash'], check=True) + docker_image], check=True) subprocess.run(['docker', 'cp', os.path.abspath(project_dir) + '/.', container_name + ':/project'], check=True) + subprocess.run(['docker', 'start', container_name]) + for config in platform_configs: if dependency_constraints: constraints_file = dependency_constraints.get_for_python_version(config.version) @@ -113,7 +115,7 @@ def build(project_dir, output_dir, test_command, before_test, test_requires, tes container_name + ':/constraints.txt'], check=True) subprocess.run( - ['docker', 'start', '-i', '-a', container_name], + ['docker', 'exec', '-i', container_name, '/bin/bash'], universal_newlines=True, check=True, input='''