first row
This commit is contained in:
19
python_docker.py
Normal file
19
python_docker.py
Normal file
@@ -0,0 +1,19 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import docker
|
||||
|
||||
client = docker.from_env()
|
||||
#print(client.info()["ContainersRunning"])
|
||||
AllImage = client.images.list(all=True)
|
||||
|
||||
def read_all_container():
|
||||
client = docker.from_env()
|
||||
AllContainer = client.containers.list(all=True)
|
||||
low_list= []
|
||||
for con in AllContainer:
|
||||
test = str(con).split(":")
|
||||
low_list.append(test[1].replace(">", ""))
|
||||
con_dict = {"container" : low_list}
|
||||
return con_dict
|
||||
|
||||
print(read_all_container()["container"])
|
||||
Reference in New Issue
Block a user