Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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']
Ejemplo n.º 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)
Ejemplo n.º 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(' '))
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)