Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /li-boxuan_OpenDevin /openhands /runtime /impl /docker /containers.py
| import docker | |
| def stop_all_containers(prefix: str) -> None: | |
| docker_client = docker.from_env() | |
| try: | |
| containers = docker_client.containers.list(all=True) | |
| for container in containers: | |
| try: | |
| if container.name and container.name.startswith(prefix): | |
| container.stop() | |
| except docker.errors.APIError: | |
| pass | |
| except docker.errors.NotFound: | |
| pass | |
| except docker.errors.NotFound: # yes, this can happen! | |
| pass | |
| finally: | |
| docker_client.close() | |
Xet Storage Details
- Size:
- 578 Bytes
- Xet hash:
- 71dd52966204cdb59170dba218790f73231fd3ff8207376c7be62606fcc15bc3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.