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

Unable to install via pip on Alpine Docker #233

Open
kggx opened this issue Nov 25, 2024 · 0 comments
Open

Unable to install via pip on Alpine Docker #233

kggx opened this issue Nov 25, 2024 · 0 comments

Comments

@kggx
Copy link

kggx commented Nov 25, 2024

I'm trying to install the pip package on the Python Alpine Docker-Image 3.12 (python:3.12-alpine). However, this is failing with ERROR: Could not find a version that satisfies the requirement demoparser2 (from versions: none). The Debian based image python:3.12 works just fine.

Due to the fact the Alpine based distribution is focusing on a small image size and security it is often used in a server-less function environment such as Google Cloud Run or AWS Lambda. Successfully building the package on said distribution would probably beneficial to many others.


Build output

[+] Building 5.6s (7/7) FINISHED                                                                                                                                                              docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                    0.0s
 => => transferring dockerfile: 326B                                                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/python:3.12-alpine                                                                                                                                   0.7s
 => [internal] load .dockerignore                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                         0.0s
 => CACHED [1/4] FROM docker.io/library/python:3.12-alpine@sha256:5049c050bdc68575a10bcb1885baa0689b6c15152d8a56a7e399fb49f783bf98                                                                      0.0s
 => [2/4] RUN apk update                                                                                                                                                                                0.8s
 => [3/4] RUN pip install --upgrade pip                                                                                                                                                                 3.3s
 => ERROR [4/4] RUN pip install demoparser2                                                                                                                                                             0.7s 
------                                                                                                                                                                                                       
 > [4/4] RUN pip install demoparser2:                                                                                                                                                                        
0.635 ERROR: Could not find a version that satisfies the requirement demoparser2 (from versions: none)                                                                                                       
0.648 ERROR: No matching distribution found for demoparser2                                                                                                                                                  
------                                                                                                                                                                                                       
Dockerfile:10
--------------------
   8 |     RUN pip install --upgrade pip
   9 |     
  10 | >>> RUN pip install demoparser2
  11 |     
  12 |     # COPY requirements.txt ./
--------------------

Dockerfile

FROM python:3.12-alpine

RUN apk update
RUN pip install --upgrade pip

RUN pip install demoparser2

CMD [ "python", "./main.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