Red5d / docker-autocompose

Generate a docker-compose yaml definition from a running container
1.77k stars 197 forks source link

Dependency versions? #9

Closed TheDevelolper closed 3 years ago

TheDevelolper commented 4 years ago

So I've been trying to get this working. I think you need to supply your dependency versions? You could try doing a pip list or pip freeze? I'm planning to give you a pull request with a requirements file so that you can just install dependencies with 1 command (and other people won't run into this problem).

Red5d commented 4 years ago

What kind of errors are you getting?

TheDevelolper commented 4 years ago

Sorry, I should have known you'd need this! 🤦‍♂️

PS D:\Repos\docker-autocompose> python autocompose.py 324733d43248 c3cb064f48de 94e795301c19
Traceback (most recent call last):
  File "autocompose.py", line 126, in <module>
    main()
  File "autocompose.py", line 15, in main
    cfile, networks = generate(cname)
  File "autocompose.py", line 33, in generate
    cid = [x.short_id for x in c.containers.list() if cname == x.name or x.short_id in cname][0]
AttributeError: 'function' object has no attribute 'list'
Red5d commented 4 years ago

Hmm... what version of the "docker" python module do you have?

bpjobin commented 4 years ago

I was getting the same error. Fixed it by installing docker 2.1.0 as described here: https://github.com/docker/docker-py/issues/2177

pip install docker==2.1.0

TheDevelolper commented 4 years ago

I didn't know you could install docker via pip?

Red5d commented 4 years ago

Its not Docker itself. Installing "docker" with pip installs the docker Python module.

phil-hudson commented 4 years ago

Should this be PR'ed into a requirements.txt file?

phil-hudson commented 4 years ago

https://github.com/Red5d/docker-autocompose/pull/11