Red5d / docker-autocompose

Generate a docker-compose yaml definition from a running container
1.91k stars 212 forks source link

Volumes null - 'NoneType' object is not iterable #43

Closed shuther closed 2 years ago

shuther commented 2 years ago

Leveraging the docker approach from https://gist.github.com/marcelrv/e7dac93863945dccc46f70915c84b5db for c in $CIDS; do mkdir ~/dockercontainers/$c ; docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose $c > ~/dockercontainers/$c/docker-compose.yml ; done leads to some errors on ubuntu 20.4/latest for some containers as per the error message:

Traceback (most recent call last): File "/usr/src/app/./autocompose.py", line 164, in main() File "/usr/src/app/./autocompose.py", line 27, in main cfile, c_networks, c_volumes = generate(cname) File "/usr/src/app/./autocompose.py", line 127, in generate for volume in values['volumes']:

It seems to relate to no volume defined as per: docker inspect dcc398077dd8

"Volumes": null,

acdoussan commented 2 years ago

Should be fixed with the latest commit, could you try that?

shuther commented 2 years ago

you answered very fast; unfortunately I removed the container that led to the issue so I can't test it further.