Skip to content

Commit

Permalink
Enable generating compose files for containers that aren't running.
Browse files Browse the repository at this point in the history
  • Loading branch information
Red5d authored Aug 7, 2021
1 parent 94ca597 commit 8ada367
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autocompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ada367

Please sign in to comment.