示例#1
0
 def inspect_container(self, service_name):
     container_id = self.container_id(service_name)
     client = get_docker_client()
     return client.inspect_container(container_id)
示例#2
0
 def remove_container(self, service_name):
     container_id = self.container_id(service_name)
     client = get_docker_client()
     client.remove_container(container_id, force=True)
示例#3
0
 def container_id(self, service_name):
     client = get_docker_client()
     return _get_container_for_app_or_service(client, service_name, include_exited=True)['Id']
示例#4
0
 def _image_exists(self, image_to_find):
     client = get_docker_client()
     all_images = client.images(all=True)
     return any(image_to_find in image['RepoTags'] for image in all_images)
示例#5
0
 def exec_in_container(self, service_name, command):
     client = get_docker_client()
     container = _get_container_for_app_or_service(client, service_name, raise_if_not_found=True)
     return _exec_in_container(client, container, *command.split(' '))
示例#6
0
 def _image_exists(self, image_to_find):
     client = get_docker_client()
     all_images = client.images(all=True)
     return any(image_to_find in image['RepoTags'] for image in all_images)
示例#7
0
 def _container_exists_in_set(self, service_name, include_exited):
     client = get_docker_client()
     container = _get_container_for_app_or_service(client, service_name, include_exited=include_exited)
     return bool(container)
示例#8
0
文件: testcases.py 项目: apeace/dusty
 def remove_container(self, service_name):
     container_id = self.container_id(service_name)
     client = get_docker_client()
     client.remove_container(container_id, force=True)
示例#9
0
文件: testcases.py 项目: apeace/dusty
 def inspect_container(self, service_name):
     container_id = self.container_id(service_name)
     client = get_docker_client()
     return client.inspect_container(container_id)