Red5d / docker-autocompose

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

Container with network within another container #48

Open LordDeimos666 opened 1 year ago

LordDeimos666 commented 1 year ago

While tring to get the docker compose of an old container that use the network of another container it gives this error:

Traceback (most recent call last): File "/root/docker-autocompose-master/autocompose.py", line 211, in <module> main() File "/root/docker-autocompose-master/autocompose.py", line 29, in main cfile, c_networks, c_volumes = generate(cname, createvolumes=args.createvolumes) File "/root/docker-autocompose-master/autocompose.py", line 140, in generate assumed_default_network = list(cattrs['NetworkSettings']['Networks'].keys())[0] IndexError: list index out of range

The old docker command for the network was --network=container:2fa4041a6e80a5499dbef6671ba30c2c40d40b70a4280db6d064bf20c43f5c6a

yeyeto2788 commented 1 year ago

Hey @LordDeimos666

Can you try this https://github.com/Red5d/docker-autocompose/pull/53? that error should go away.

LordDeimos666 commented 1 year ago

Sorry for the late answer. Not working, the nested network mode is not giving any result. I expect to have for example: network_mode: "service:wireguard"