From 09f14bceca94c8fae4a34b57462634f4fbae3ecb Mon Sep 17 00:00:00 2001 From: akshay-scalegrowth Date: Sun, 14 Mar 2021 16:29:06 +1100 Subject: [PATCH 1/4] Added gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04fc354 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv +.vscode \ No newline at end of file From 555f1f90b3af7535760369c468977068ba8ee7fd Mon Sep 17 00:00:00 2001 From: akshay-scalegrowth Date: Sun, 14 Mar 2021 16:29:26 +1100 Subject: [PATCH 2/4] Added requirements.txt for required packages --- requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 requirements.txt 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 From a3ff6534abad0b9122729ec77ed99ba2c194bfc5 Mon Sep 17 00:00:00 2001 From: Akshay Salunke Date: Sun, 14 Mar 2021 17:50:13 +1100 Subject: [PATCH 3/4] ignore ds_store file for mac --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 04fc354..ee66804 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ venv -.vscode \ No newline at end of file +.vscode +.DS_Store \ No newline at end of file From 98704a81b6052a99310103b1fe59e8a58796dd08 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 14 Mar 2021 21:05:41 +1100 Subject: [PATCH 4/4] Fix 'networks' in yaml fix opts following official compose reference [docker-compose reference](https://docs.docker.com/compose/compose-file/compose-file-v3/) --- autocompose.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.