Red5d / docker-autocompose

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

command property: replace string concatenation by taking over given list #34

Closed alpex8 closed 2 years ago

alpex8 commented 2 years ago

Hi,

I noticed that the script is converting the command property. The specification allows to have

  1. a string where arguments are separated by whitespaces
    command: mycommand arg1 arg2 --flag1 'param'
  2. a list where all arguments are list items
    command:
    - mycommand
    - arg1
    - arg2
    - --flag1
    - \'param\'

However the Script generated a List with one string item that included all arguments. That resulted in an error.

command:
  - mycommand arg1 arg2 --flag1 'param'

Thus I removed the usage of " ".join() and took over the list which is generated by docker anyway.

Furthermore I came across the issue that the script only collects the networks to which the last container is connected. This has also been fixed.