Created
June 20, 2019 02:31
-
-
Save pasknel/dd261045e1846cbc87b0bedfa6836e10 to your computer and use it in GitHub Desktop.
List Docker Containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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