Created
September 22, 2017 04:04
-
-
Save u1i/5800c4fee56c22e433e0a6fcd25cadc3 to your computer and use it in GitHub Desktop.
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 os | |
from docker import Client | |
from docker.utils import kwargs_from_env | |
kwargs = kwargs_from_env() | |
client = Client(**kwargs) | |
containers = client.containers() | |
builders = [c for c in containers if c['Image'] == 'u1ih/builder-runtime'] | |
ids = [s['Id'] for s in builders] | |
urls = [s['Ports'][0]['IP'] + ':' + str(s['Ports'][0]['PublicPort']) for s in builders] | |
print urls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment