Beispiel #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)
Beispiel #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)
Beispiel #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']
Beispiel #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)
Beispiel #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(' '))
Beispiel #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)
Beispiel #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)
Beispiel #8
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)
Beispiel #9
0
 def inspect_container(self, service_name):
     container_id = self.container_id(service_name)
     client = get_docker_client()
     return client.inspect_container(container_id)