kumquat-buildroot/support/testing/tests/package/sample_python_docker.py
Peter Korsgaard 0bb63c6f5a support/testing: add python-docker test
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>
2023-06-17 18:52:53 +02:00

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])