Created
May 30, 2017 22:09
-
-
Save thebostik/db775b2d94da23e7894dd80ef3585ef5 to your computer and use it in GitHub Desktop.
Mozjpeg + Pillow Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:xenial | |
RUN apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ | |
# build tools | |
nasm \ | |
build-essential \ | |
autoconf \ | |
automake \ | |
libtool \ | |
pkg-config \ | |
# python tools | |
python \ | |
python-dev \ | |
python-pip \ | |
python-setuptools \ | |
# cleanup | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Download and compile mozjpeg | |
ADD https://github.com/mozilla/mozjpeg/archive/v3.2-pre.tar.gz /mozjpeg-src/v3.2-pre.tar.gz | |
RUN tar -xzf /mozjpeg-src/v3.2-pre.tar.gz -C /mozjpeg-src/ | |
WORKDIR /mozjpeg-src/mozjpeg-3.2-pre | |
RUN autoreconf -fiv \ | |
&& ./configure --with-jpeg8 \ | |
&& make install prefix=/usr libdir=/usr/lib64 | |
RUN echo "/usr/lib64\n" > /etc/ld.so.conf.d/mozjpeg.conf | |
RUN ldconfig | |
# Build Pillow | |
RUN pip install virtualenv \ | |
&& virtualenv /virtualenv_run \ | |
&& /virtualenv_run/bin/pip install --upgrade pip \ | |
&& /virtualenv_run/bin/pip install --no-binary=:all: Pillow==4.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment