def stop(): log.debug("Stopping all containers") running_containers = Container.get_containers(status=Status.Running) for container in running_containers: container.remove()
def remove_stopped(): log.debug("Removing stopped containers") stopped_containers = Container.get_containers(status=Status.Stopped) for container in stopped_containers: cmd = "docker rm {}".format(container.id) run_command(cmd)