Skip to content

Instantly share code, notes, and snippets.

@pasknel
Created June 20, 2019 02:31
Show Gist options
  • Save pasknel/dd261045e1846cbc87b0bedfa6836e10 to your computer and use it in GitHub Desktop.
Save pasknel/dd261045e1846cbc87b0bedfa6836e10 to your computer and use it in GitHub Desktop.
List Docker Containers
import docker
client = docker.from_env()
for container in client.containers.list():
print "[*] Container ID: {0}".format(container.short_id)
print "[*] Container Image: {0}".format(container.image.tags[-1])
print "[*] Container Name: {0}".format(container.name)
print ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment