diff --git a/podman_compose.py b/podman_compose.py index 866a7e7..3b59858 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -828,6 +828,10 @@ class PodmanCompose: print(" ** merged:\n", json.dumps(compose, indent = 2)) ver = compose.get('version') services = compose.get('services') + if services is None: + services = {} + print("WARNING: No services defined") + # NOTE: maybe add "extends.service" to _deps at this stage flat_deps(services, with_extends=True) service_names = sorted([ (len(srv["_deps"]), name) for name, srv in services.items() ]) diff --git a/tests/no_services/docker-compose.yaml b/tests/no_services/docker-compose.yaml new file mode 100644 index 0000000..c5b0194 --- /dev/null +++ b/tests/no_services/docker-compose.yaml @@ -0,0 +1,7 @@ +version: '3' +networks: + shared-network: + driver: bridge + ipam: + config: + - subnet: 172.19.0.0/24