Red5d / docker-autocompose

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

Adding Name Attribute to each Network #37

Closed alpex8 closed 2 years ago

alpex8 commented 2 years ago

Hi,

the script currently retrieves the network names as is and writes them into the compose file.

When using that compose file docker compose is adding the directory name as prefix to the network name. This is no problem if a whole multi-container deployment is replaced by another coming from the generated compose file.

However I´m using this script to replace only a subset of containers by a docker-compose definition and that portion is supposed to communicate to the other containers which were left untouched. So I need the recreated containers in the same networks as the untouched ones. To achieve that, I added the name: attribute to each network next to the external: which is already there.

alpex8 commented 2 years ago

@Red5d Any update on this? Could you merge this PR?