0bb63c6f5a
Python-docker needs a working docker setup to do anything useful, so add it to the existing docker_compose (which tests docker and docker-compose) rather than adding a completely new test. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Christian Stewart <christian@aperture.us> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
13 lines
214 B
Python
13 lines
214 B
Python
import docker
|
|
|
|
client = docker.from_env()
|
|
info = client.info()
|
|
images = client.images.list()
|
|
|
|
assert len(images) > 0
|
|
|
|
print('Version:', info['ServerVersion'])
|
|
print('Images:')
|
|
for i in images:
|
|
print(i.tags[0])
|