docker-hub-frolvlad / docker-alpine-python3 Goto Github PK
View Code? Open in Web Editor NEWThe smallest Docker image with Python 3.7 (~57MB)
Home Page: https://hub.docker.com/r/frolvlad/alpine-python3/
License: MIT License
The smallest Docker image with Python 3.7 (~57MB)
Home Page: https://hub.docker.com/r/frolvlad/alpine-python3/
License: MIT License
I have a simple case of trying to install jinja2 .. or netifaces (needs python-dev also)
Example 1:
vagrant@vagrant-ubuntu-trusty-64:~$ docker run --rm frolvlad/alpine-python3 pip install netifaces
Collecting netifaces
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/netifaces/
# the above should download, then fail as we don't have python-dev .. but it can't download it to start with
# times-out
Example 2 :
Times out after finding the jinja2 package, and tries to locate MarkupSafe
vagrant@vagrant-ubuntu-trusty-64:~$ docker run --rm frolvlad/alpine-python3 pip install jinja2
Collecting jinja2
Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
Collecting MarkupSafe (from jinja2)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/markupsafe/
some error message:
creating python_build/lib.linux-x86_64-3.7/grpc/_cython/_credentials
copying src/python/grpcio/grpc/_cython/_credentials/roots.pem -> python_build/lib.linux-x86_64-3.7/grpc/_cython/_credentials
running build_ext
error: [Errno 2] No such file or directory: 'cc': 'cc'
I find your docker image neat to download a Python3.6 image to CodeBuild, I also need to use pip against Python3.6 to install other dependency libraries. Can you tell me how can I do that?
I tried "python3 -m pip install -t 'lib' injector==0.12.1" but encountered error: cannot find pip module under python3.
FYI,
I am using docker image: aws/codebuild/docker:1.12.1 from http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html, since the docker image above preinstalled pip.
Thanks!
Hello (and thanks for this docker image!)
We have a django-base image which builds on yours - today I did a new build of it and I get a segfault when running the Django dev server with auto reload on. I've been digging through a bunch of issues across Github on this, and noticed you in this thread. I noticed at the bottom of that thread there's someone mentioning that he segfault is back for them in Alpine 3.8. There's a thread about it specific to the django dev server here too.
For now, the threading.stack_size(2*1024*1024)
workaround is working for me but I thought you might like to know that the issue seems to be back.
The upgrade last month to Alpine 3.19 seems to be causing this error in my build. Docker Hub doesn't appear to show a tag other than latest. Is there any way for me to use the previous version?
Thanks!
[2024-02-27 00:22:22] │ INFO[0047] Running: [/bin/sh -c pip install -r requirements.txt]
[2024-02-27 00:22:24] │ INFO[0049] Pushed <registry-uri-7>
[2024-02-27 00:22:25] │ error: externally-managed-environment
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ × This environment is externally managed
[2024-02-27 00:22:25] │ ╰─>
[2024-02-27 00:22:25] │ The system-wide python installation should be maintained using the system
[2024-02-27 00:22:25] │ package manager (apk) only.
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ If the package in question is not packaged already (and hence installable via
[2024-02-27 00:22:25] │ "apk add py3-somepackage"), please consider installing it inside a virtual
[2024-02-27 00:22:25] │ environment, e.g.:
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ python3 -m venv /path/to/venv
[2024-02-27 00:22:25] │ . /path/to/venv/bin/activate
[2024-02-27 00:22:25] │ pip install mypackage
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ To exit the virtual environment, run:
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ deactivate
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ The virtual environment is not deleted, and can be re-entered by re-sourcing
[2024-02-27 00:22:25] │ the activate file.
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ To automatically manage virtual environments, consider using pipx (from the
[2024-02-27 00:22:25] │ pipx package).
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
[2024-02-27 00:22:25] │ hint: See PEP 668 for the detailed specification.
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ [notice] A new release of pip is available: 23.3.2 -> 24.0
[2024-02-27 00:22:25] │ [notice] To update, run: pip install --upgrade pip
[2024-02-27 00:22:25] │ error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
[2024-02-27 00:22:25] │
[2024-02-27 00:22:25] │ command exited with code 1
In Docker Hub, this image has description as below.
"The smallest Docker image with Python 3.5 (~61MB) "
If you are not busy, how about change it to "The smallest Docker image with Python 3.6 (~61MB)" as github description?
thanks.
Any idea on which dependencies need to be installed in alpine linux to be able to pip install psycopg2
?
just like this:
RUN python3 -m ensurepip && pip3 install --upgrade pip
Using docker image sha256:80484c205b6584533f3e1333a2d0059d8a954488a005723885a619e63f90bc60 for frolvlad/alpine-python3:latest with digest frolvlad/alpine-python3@sha256:69f108d85ddb473123c5fdae3f415aee900f0bccd2e78523f7ceba23a9688b0e ...
$ pip install --upgrade pylint
Collecting pylint
Downloading pylint-2.7.4-py3-none-any.whl (346 kB)
Collecting astroid<2.7,>=2.5.2
Downloading astroid-2.5.3-py3-none-any.whl (226 kB)
Collecting isort<6,>=4.2.5
Downloading isort-5.8.0-py3-none-any.whl (103 kB)
Collecting lazy-object-proxy>=1.4.0
Downloading lazy-object-proxy-1.6.0.tar.gz (44 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Collecting mccabe<0.7,>=0.6
Downloading mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
Collecting toml>=0.7.1
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting wrapt<1.13,>=1.11
Downloading wrapt-1.12.1.tar.gz (27 kB)
Building wheels for collected packages: lazy-object-proxy, wrapt
Building wheel for lazy-object-proxy (PEP 517): started
Building wheel for lazy-object-proxy (PEP 517): finished with status 'done'
Created wheel for lazy-object-proxy: filename=lazy_object_proxy-1.6.0-cp38-cp38-linux_x86_64.whl size=11347 sha256=a2cdfc4c790f1845040c286bfeb322d8b976fb5da6511db945ef03c33e5e6913
Stored in directory: /root/.cache/pip/wheels/25/31/33/2d2448eb3f67feb67321b65057a2fc4404cd4a6d6392cb51fb
Building wheel for wrapt (setup.py): started
Building wheel for wrapt (setup.py): finished with status 'done'
Created wheel for wrapt: filename=wrapt-1.12.1-py3-none-any.whl size=19553 sha256=71a6922d081cf7ee454aafe09827828ba0d1132d56d9fabf56380260fae273ed
Stored in directory: /root/.cache/pip/wheels/5f/fd/9e/b6cf5890494cb8ef0b5eaff72e5d55a70fb56316007d6dfe73
Successfully built lazy-object-proxy wrapt
Installing collected packages: wrapt, lazy-object-proxy, toml, mccabe, isort, astroid, pylint
Successfully installed astroid-2.5.3 isort-5.8.0 lazy-object-proxy-1.6.0 mccabe-0.6.1 pylint-2.7.4 toml-0.10.2 wrapt-1.12.1
WARNING: You are using pip version 20.3.3; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
$ pylint --rcfile=./testbed_ms/pylintrc testbed_ms/
Traceback (most recent call last):
File "/usr/bin/pylint", line 8, in <module>
sys.exit(run_pylint())
File "/usr/lib/python3.8/site-packages/pylint/__init__.py", line 24, in run_pylint
PylintRun(sys.argv[1:])
File "/usr/lib/python3.8/site-packages/pylint/lint/run.py", line 317, in __init__
linter.load_plugin_modules(plugins)
File "/usr/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 503, in load_plugin_modules
module = astroid.modutils.load_module_from_name(modname)
File "/usr/lib/python3.8/site-packages/astroid/modutils.py", line 210, in load_module_from_name
return importlib.import_module(dotted_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'util'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.