I am playing with docker sdk for python in the flask app. But I am facing some errors while using it. I think doc's should add the usage area for flask framework.
from flask import Flask
import docker
app = Flask(__name__)
@app.route("/")
def getAllAvailableImages():
client = docker.APIClient()
client = client.from_env()
api = client.api
for image in api.images.list():
print(image.id)
(.venv) ➜ kasm-streaming flask --app app run
Usage: flask run [OPTIONS]
Try 'flask run --help' for help.
Error: While importing 'app', an ImportError was raised:
Traceback (most recent call last):
File "/Users/irtaza/Desktop/Developer/Ideas/ondemand/kasm-streaming/.venv/lib/python3.12/site-packages/flask/cli.py", line 245, in locate_app
__import__(module_name)
File "/Users/irtaza/Desktop/Developer/Ideas/ondemand/kasm-streaming/app.py", line 2, in <module>
import docker
ModuleNotFoundError: No module named 'docker'
I am playing with docker sdk for python in the flask app. But I am facing some errors while using it. I think doc's should add the usage area for flask framework.
(.venv) ➜ kasm-streaming flask --app app run Usage: flask run [OPTIONS] Try 'flask run --help' for help.