You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where I use gunicorn and swagger.
I can generate the image and run the server without a problem. The size of image generated is 685MB
I decided to try docker-slim. The size of image generated with docker-slim is 63.3MB . Woohoo!!!
However, when running the application using the slim image, and trying to access the ui generated by swagger, there is a problem (this problem does not happen with the "full" image).
Here is the error:
2023-01-11 01:51:45,286 - qainfra_core_service.__main__ - ERROR - Exception on /api/v1/ui/ [GET]
Traceback (most recent call last):
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/venv/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/venv/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/venv/lib/python3.9/site-packages/connexion/apis/flask_api.py", line 299, in console_ui_home
return flask.render_template('index.j2', **template_variables)
File "/opt/venv/lib/python3.9/site-packages/flask/templating.py", line 138, in render_template
ctx.app.jinja_env.get_or_select_template(template_name_or_list),
File "/opt/venv/lib/python3.9/site-packages/flask/helpers.py", line 957, in __get__
value = self.func(obj)
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 689, in jinja_env
return self.create_jinja_environment()
File "/opt/venv/lib/python3.9/site-packages/flask/app.py", line 781, in create_jinja_environment
rv = self.jinja_environment(self, **options)
File "/opt/venv/lib/python3.9/site-packages/flask/templating.py", line 45, in __init__
BaseEnvironment.__init__(self, **options)
File "/opt/venv/lib/python3.9/site-packages/jinja2/environment.py", line 359, in __init__
self.extensions = load_extensions(self, extensions)
File "/opt/venv/lib/python3.9/site-packages/jinja2/environment.py", line 108, in load_extensions
extension = import_string(extension)
File "/opt/venv/lib/python3.9/site-packages/jinja2/utils.py", line 131, in import_string
return getattr(__import__(module, None, None, [obj]), obj)
ModuleNotFoundError: No module named 'jinja2.ext'
P.S. jinja2 and jinja2-ext are installed.
P.S.2. ENTRYPOINT and CMD instructions look like in your Dockerfile:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a project where I use gunicorn and swagger.
I can generate the image and run the server without a problem. The size of image generated is 685MB
I decided to try docker-slim. The size of image generated with docker-slim is 63.3MB . Woohoo!!!
However, when running the application using the slim image, and trying to access the ui generated by swagger, there is a problem (this problem does not happen with the "full" image).
Here is the error:
P.S. jinja2 and jinja2-ext are installed.
P.S.2. ENTRYPOINT and CMD instructions look like in your Dockerfile:
Beta Was this translation helpful? Give feedback.
All reactions