Skip to content

Commit

Permalink
Remove hard-coded shell info to use the docker ENTRYPOINT instead
Browse files Browse the repository at this point in the history
This lets us use the 'linux32 bash' that's specified by the i686 docker
images, without specifying it explicitly.
  • Loading branch information
joerick committed Jun 24, 2020
1 parent 31339ba commit a052c71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions cibuildwheel/docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,19 @@ class DockerContainer:
bash_stdin: IO[str]
bash_stdout: IO[str]

def __init__(self, docker_image: str, simulate_32_bit=False):
def __init__(self, docker_image: str):
self.docker_image = docker_image
self.simulate_32_bit = simulate_32_bit

def __enter__(self) -> 'DockerContainer':
self.container_name = f'cibuildwheel-{uuid.uuid4()}'
shell_args = ['linux32', '/bin/bash'] if self.simulate_32_bit else ['/bin/bash']
subprocess.run(
[
'docker', 'create',
'--env', 'CIBUILDWHEEL',
'--name', self.container_name,
'-i',
'-v', '/:/host', # ignored on CircleCI
self.docker_image,
*shell_args
self.docker_image
],
check=True,
)
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def build(options: BuildOptions) -> None:
continue

try:
with DockerContainer(docker_image, simulate_32_bit=platform_tag.endswith('i686')) as docker:
with DockerContainer(docker_image) as docker:
docker.copy_into(Path.cwd(), Path('/project'))

if options.before_all:
Expand Down

0 comments on commit a052c71

Please sign in to comment.