“The headers or library files could not be found for jpeg” installing Pillow on Alpine Linux
For debian sudo apt install libjpeg-dev zlib1g-dev pip install Pillow
For debian sudo apt install libjpeg-dev zlib1g-dev pip install Pillow
Tested with Python 3.4.8, 3.5.5, 3.6.5 and 2.7.14 (just replace 3 with 2): # You can use a specific version too, like python:3.6.5-alpine3.7 FROM python:3-alpine WORKDIR /usr/src/app COPY requirements.txt . RUN \ apk add –no-cache postgresql-libs && \ apk add –no-cache –virtual .build-deps gcc musl-dev postgresql-dev && \ python3 -m pip install -r requirements.txt –no-cache-dir … Read more
In docker-Context here are the important informations you need. Alpine Url: https://alpinelinux.org/ Imagename: alpine Shorty: Its very small. Packagemanger: apk Shells: /bin/sh Size: Few MBs – current tag needs 2.7MB Jessie aka Debian 8 Url: https://wiki.debian.org/DebianJessie Imagename: debian:jessie Shorty: No LTS anymore Packagemanager: apt Shells: /bin/bash Size: ~50mb Stretch aka Debian 9 Url: https://wiki.debian.org/DebianStretch Imagename: … Read more
This is what I use in a Dockerfile for an alpine image: # Install python/pip ENV PYTHONUNBUFFERED=1 RUN apk add –update –no-cache python3 && ln -sf python3 /usr/bin/python RUN python3 -m ensurepip RUN pip3 install –no-cache –upgrade pip setuptools
Alpine uses the command adduser and addgroup for creating users and groups (rather than useradd and usergroup). FROM alpine:latest # Create a group and user RUN addgroup -S appgroup && adduser -S appuser -G appgroup # Tell docker that all future commands should run as the appuser user USER appuser The flags for adduser are: … Read more
Debian based images use only python pip to install packages with .whl format: Downloading pandas-0.22.0-cp36-cp36m-manylinux1_x86_64.whl (26.2MB) Downloading numpy-1.14.1-cp36-cp36m-manylinux1_x86_64.whl (12.2MB) WHL format was developed as a quicker and more reliable method of installing Python software than re-building from source code every time. WHL files only have to be moved to the correct location on the target … Read more
The –no-cache option allows to not cache the index locally, which is useful for keeping containers small. Literally it equals apk update in the beginning and rm -rf /var/cache/apk/* in the end. Some example where we use –no-cache option: $ docker run -ti alpine:3.7 / # apk add nginx WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file … Read more
Alpine Linux uses musl libc. You probably need to install musl-dev.
Why is alpine not used any more as a base image for Java 11 slim images? That’s because, sadly, there is no official stable OpenJDK 11 build for Alpine currently. Alpine uses musl libc, as opposed to the standard glibc used by most Linuxes out there, which means that a JVM must be compatible with … Read more
If you see the documentation -t, –virtual NAME Instead of adding all the packages to ‘world’, create a new virtual package with the listed dependencies and add that to ‘world’; the actions of the command are easily reverted by deleting the virtual package What that means is when you install packages, those packages are not … Read more