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.
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 theexternal:
which is already there.