我想要与以下命令等效的Python:
docker rmi $(docker images -q -a)
remove
方法等效于rmi
,但-q
和-a
选项如何?
以下将正常工作:
for image in client.images.list():
print("Image: ", image.tags)
client.images.remove(image=tag, force=True)