diff --git a/compose_viz/service.py b/compose_viz/service.py index acf28aa..f1da6a8 100644 --- a/compose_viz/service.py +++ b/compose_viz/service.py @@ -6,6 +6,10 @@ from compose_viz.extends import Extends class Service: def __init__(self, name: str, image: str = None, ports: List[str] = [], networks: List[str] = [], volumes: List[str] = [], depends_on: List[str] = [], links: List[str] = [], extends: Extends = None) -> None: self._name = name + + if image is None and extends is None: + raise ValueError(f"Both image and extends are not defined in service '{name}', aborting.") + self._image = image self._ports = ports self._networks = networks