alpine-linux

Docker Alpine build fails on mysqlclient installation with error: Exception: Can not find valid pkg-config name

Docker Alpine build fails on mysqlclient installation with error: Exception: Can not find valid pkg-config name Question: I’m encountering a problem when building a Docker image using a Python-based Dockerfile. I’m trying to use the mysqlclient library (version 2.2.0) and Django (version 4.2.2). Here is my Dockerfile: FROM python:3.11-alpine WORKDIR /usr/src/app COPY requirements.txt . RUN …

Total answers: 7

Ansible: The ipaddr filter requires python's netaddr be installed on the ansible controller

Ansible: The ipaddr filter requires python's netaddr be installed on the ansible controller Question: Docker container Alpine.3.13.1 apk add ansible succeeds however, executing playbooks that require ipaddr filter fails with: Ansible: The ipaddr filter requires python’s netaddr be installed on the ansible controller Ansible version: 2.10.5 (can do other versions if needed) ipaddr filter: Ansible …

Total answers: 3

How to install matplotlib on Alpine

How to install matplotlib on Alpine Question: Trying to install matplotlib on an alpine docker image. I get a bunch of ugly messages. Am I missing some additional pre-req that needs to be manually installed? Here is docker file: FROM openjdk:8-jre-alpine RUN apk update RUN apk add –no-cache tesseract-ocr RUN echo import numpy, matplotlib, skimage, …

Total answers: 3

How to make lightweight docker image for python app with pipenv

How to make lightweight docker image for python app with pipenv Question: I can produce working image for my python app with following simple Dockerfile: FROM python:3.7 WORKDIR /myapp COPY Pipfile* ./ RUN pip install pipenv RUN pipenv install –system –deploy COPY src . CMD [“python3”, “app.py”] However, it will produce ~1 GB image, which …

Total answers: 4

Use Python package installed with apk in Alpine Linux

Use Python package installed with apk in Alpine Linux Question: I’d like to install some Python packages in Alpine Linux using apk. I use numpy as an example in the following. Dockerfile FROM python:3-alpine RUN apk add –update py3-numpy I build my Docker image $ docker build -t python-numpy . Sending build context to Docker …

Total answers: 4

Error installing gevent in Docker Alpine Python

Error installing gevent in Docker Alpine Python Question: I’m trying to install gevent on docker image python:3.8.0a4-alpine3.9 which is running gunicorn. When building the docker, I always get an error "gcc failed with exit status 1". I’ve tried installing several packages but none have worked. Here is the Dockerfile: FROM python:3.8.0a4-alpine3.9 RUN echo "@edge-community http://dl-cdn.alpinelinux.org/alpine/edge/community" …

Total answers: 5

ImportError: The _imagingft C module is not installed in alpine-docker

ImportError: The _imagingft C module is not installed in alpine-docker Question: I am attempting to import and use the python pillow library like this: from urllib.request import urlopen import PIL from PIL import Image, ImageFont, ImageDraw import re image = Image.open(urlopen(“http://randomurl.com/randomimage.jpg”)) draw = ImageDraw.Draw(image) font = ImageFont.truetype(“sans-serif.ttf”, 16) draw.text((0, 0),”This is the future liberals want”,(255,255,255),font=font) …

Total answers: 2