Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Running pip as the 'root' user can result in broken permissions #402

Open
mchendriks opened this issue Nov 4, 2024 · 0 comments

Comments

@mchendriks
Copy link

I was following your guide, but the results where not what I expected. :)

docker build -t machen/catnip .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/

Sending build context to Docker daemon 8.704kB
Step 1/6 : FROM python:3.8
3.8: Pulling from library/python
cdd62bf39133: Pull complete
a47cff7f31e9: Pull complete
a173f2aee8e9: Pull complete
01272fe8adba: Pull complete
cddc73e4e6c7: Pull complete
cc48f13b5f0f: Pull complete
5a98c896c047: Pull complete
Digest: sha256:d411270700143fa2683cc8264d9fa5d3279fd3b6afff62ae81ea2f9d070e390c
Status: Downloaded newer image for python:3.8
---> 3ea6eaad4f17
Step 2/6 : WORKDIR /usr/src/app
---> Running in b4877d0f6df2
Removing intermediate container b4877d0f6df2
---> dedb9a707155
Step 3/6 : COPY . .
---> bb19601de422
Step 4/6 : RUN pip install --no-cache-dir -r requirements.txt
---> Running in 7a20545a6b82
Collecting Flask==2.0.2
Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.2/95.2 kB 5.8 MB/s eta 0:00:00
Collecting Jinja2>=3.0
Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.3/133.3 kB 11.5 MB/s eta 0:00:00
Collecting itsdangerous>=2.0
Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting click>=7.1.2
Downloading click-8.1.7-py3-none-any.whl (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.9/97.9 kB 11.3 MB/s eta 0:00:00
Collecting Werkzeug>=2.0
Downloading werkzeug-3.0.6-py3-none-any.whl (227 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 228.0/228.0 kB 11.9 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26 kB)
Installing collected packages: MarkupSafe, itsdangerous, click, Werkzeug, Jinja2, Flask
Successfully installed Flask-2.0.2 Jinja2-3.1.4 MarkupSafe-2.1.5 Werkzeug-3.0.6 click-8.1.7 itsdangerous-2.2.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 24.3.1
[notice] To update, run: pip install --upgrade pip
Removing intermediate container 7a20545a6b82
---> ef51b25c2136
Step 5/6 : EXPOSE 5000
---> Running in fe47f1f6a70d
Removing intermediate container fe47f1f6a70d
---> 9d3226bf2008
Step 6/6 : CMD ["python", "./app.py"]
---> Running in 1c7cdd80f8a3
Removing intermediate container 1c7cdd80f8a3
---> 7126d9368160
Successfully built 7126d9368160
Successfully tagged machen/catnip:latest
matthieu@develop:~/docker-curriculum/flask-app$ docker run -p 8888:5000 machen/catnip
Traceback (most recent call last):
File "./app.py", line 1, in
from flask import Flask, render_template
File "/usr/local/lib/python3.8/site-packages/flask/init.py", line 7, in
from .app import Flask as Flask
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 28, in
from . import cli
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 18, in
from .helpers import get_debug_flag
File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 16, in
from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.8/site-packages/werkzeug/urls.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant