- docker assistant
#!/usr/local/bin/python3
import sh
names = sh.docker("ps", "--format", '{{.Names}}')
for name in names:
ip = sh.docker("inspect", '-f', '"{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}"', name.strip())
mount_info = sh.docker("inspect", '-f', '"{{ .Mounts }}"', name.strip())
print(name,ip, mount_info)