From 5caef40378522e27255177569901c4516689a20c Mon Sep 17 00:00:00 2001 From: --global <--global> Date: Thu, 15 Dec 2022 11:24:21 -0600 Subject: [PATCH] Update and add stuff --- docker_wrapper.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docker_wrapper.py b/docker_wrapper.py index 1316e94..4e07ef0 100644 --- a/docker_wrapper.py +++ b/docker_wrapper.py @@ -58,7 +58,7 @@ class Docker: return containers - def container_info(raw_info=getoutput('docker container list')): + def all_containers_info(raw_info=getoutput('docker container list')): """ Gets info about all the Docker containers :return: Nested dict of containers info @@ -94,6 +94,17 @@ class Docker: raw_info.split('\n')[i][start_i:end_i].strip() return info + + def container_info(container): + """ + Returns the info about a given container + :parameters: + container: The container you want info about + + :returns: + dict: The info about the container + """ + return Docker.all_containers_info()[container] def compose(dir): """