(client, image)
| 113 | |
| 114 | @contextlib.contextmanager |
| 115 | def run_container(client, image): |
| 116 | container = client.containers.run( |
| 117 | image, command=["/bin/sleep", "86400"], detach=True |
| 118 | ) |
| 119 | try: |
| 120 | yield container |
| 121 | finally: |
| 122 | container.stop(timeout=0) |
| 123 | container.remove() |
| 124 | |
| 125 | |
| 126 | def container_exec(container, command, user="build", environment=None): |