diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ee66804 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +venv +.vscode +.DS_Store \ No newline at end of file diff --git a/autocompose.py b/autocompose.py index 73ec4ca..25eab9e 100644 --- a/autocompose.py +++ b/autocompose.py @@ -60,7 +60,7 @@ def generate(cname): #'log_driver': cattrs['HostConfig']['LogConfig']['Type'], #'log_opt': cattrs['HostConfig']['LogConfig']['Config'], 'logging': {'driver': cattrs['HostConfig']['LogConfig']['Type'], 'options': cattrs['HostConfig']['LogConfig']['Config']}, - 'networks': {x: {'aliases': cattrs['NetworkSettings']['Networks'][x]['Aliases']} for x in cattrs['NetworkSettings']['Networks'].keys()}, + 'networks': {x for x in cattrs['NetworkSettings']['Networks'].keys()}, 'security_opt': cattrs['HostConfig']['SecurityOpt'], 'ulimits': cattrs['HostConfig']['Ulimits'], 'volumes': cattrs['HostConfig']['Binds'], @@ -87,7 +87,7 @@ def generate(cname): networklist = c.networks.list() networks = {} for network in networklist: - if network.attrs['Name'] in values['networks'].keys(): + if network.attrs['Name'] in values['networks']: networks[network.attrs['Name']] = {'external': (not network.attrs['Internal'])} # Check for command and add it if present. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3b90ebd --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pyaml==20.4.0 +docker==4.4.4 \ No newline at end of file