python-on-whales

Mock Python-On-Whales

Mock Python-On-Whales Question: With a Pyhton script I want to determine, if a docker container is running. For this, I use python-on-whales. Something this way: check_container.py from python_on_whales import docker class Container: def __init__(self, name): self.name = name def is_running(self): container_found = self.search_container() if container_found: for container in self.get_container_state(): if container.state.status == "running": return True …

Total answers: 1