19 lines
492 B
Python
19 lines
492 B
Python
#! /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"]) |