From 8ada367b9eb5594c976ce1c0d50f2b8a927c45f5 Mon Sep 17 00:00:00 2001 From: Red5d Date: Sat, 7 Aug 2021 13:51:02 -0400 Subject: [PATCH] Enable generating compose files for containers that aren't running. --- autocompose.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autocompose.py b/autocompose.py index 3527e7f..dcdf84b 100644 --- a/autocompose.py +++ b/autocompose.py @@ -30,9 +30,9 @@ def generate(cname): c = docker.from_env() try: - cid = [x.short_id for x in c.containers.list() if cname == x.name or x.short_id in cname][0] + cid = [x.short_id for x in c.containers.list(all=True) if cname == x.name or x.short_id in cname][0] except IndexError: - print("That container is not running.") + print("That container is not available.") sys.exit(1) cattrs = c.containers.get(cid).attrs