diff --git a/compose_viz/service.py b/compose_viz/service.py index f1da6a8..feaaf53 100644 --- a/compose_viz/service.py +++ b/compose_viz/service.py @@ -10,6 +10,9 @@ class Service: if image is None and extends is None: raise ValueError(f"Both image and extends are not defined in service '{name}', aborting.") + if image is not None and extends is not None: + raise ValueError(f"Only one of image and extends can be defined in service '{name}', aborting.") + self._image = image self._ports = ports self._networks = networks