Skip to content

Commit 8ada367

Browse files
authored
Enable generating compose files for containers that aren't running.
1 parent 94ca597 commit 8ada367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autocompose.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ def generate(cname):
3030
c = docker.from_env()
3131

3232
try:
33-
cid = [x.short_id for x in c.containers.list() if cname == x.name or x.short_id in cname][0]
33+
cid = [x.short_id for x in c.containers.list(all=True) if cname == x.name or x.short_id in cname][0]
3434
except IndexError:
35-
print("That container is not running.")
35+
print("That container is not available.")
3636
sys.exit(1)
3737

3838
cattrs = c.containers.get(cid).attrs

0 commit comments

Comments
 (0)