-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Similar to this issue from early 2015 #51 on Ubuntu 16.04, following the build instructions precisely (apt installs ImageMagick v6.8.9) building imgmin fails. Also worth noting I had to manually export MAGICK_CONFIG=/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config or config/make would fail to find the config and would result in an error like --cflags: command not found since the MAGICK_CONFIG default value falls back to an empty string.
The error details:
root@1edbd36cf720:/root/imgmin-1.1# make
make all-recursive
make[1]: Entering directory '/root/imgmin-1.1'
Making all in src
make[2]: Entering directory '/root/imgmin-1.1/src'
gcc -W -Wall -Os `/usr/bin/GraphicsMagickWand-config --cflags --cppflags` -o imgmin imgmin.c dssim.c `/usr/bin/GraphicsMagickWand-config --ldflags --libs` -lm
imgmin.c:28:29: fatal error: wand/MagickWand.h: No such file or directory
compilation terminated.
dssim.c: In function ‘convert_image_row’:
dssim.c:304:55: warning: unused parameter ‘inf’ [-Wunused-parameter]
static void convert_image_row(const dssim_info *const inf, float *const channels[], const int num_channels, const int y, const int width, void *user_data)
^
Makefile:566: recipe for target 'imgmin' failed
make[2]: *** [imgmin] Error 1
make[2]: Leaving directory '/root/imgmin-1.1/src'
Makefile:355: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/imgmin-1.1'
Makefile:296: recipe for target 'all' failed
make: *** [all] Error 2
I'm using Docker, phusion/baseimage:0.9.19 which is ubuntu 16.04. Here's a minimal Dockerfile that will reproduce the issue:
FROM phusion/baseimage:0.9.19
# Use baseimage-docker's init system.
CMD [ /sbin/my_init ]
# upgrade
RUN apt-get update && apt-get dist-upgrade -y
# build tools (uninstall afterwards)
RUN apt-get install -y \
build-essential \
dh-autoreconf \
wget
RUN apt-get install -y libpng-dev
RUN cd && wget https://github.com/pornel/pngquant/archive/2.5.0.tar.gz && \
tar xf 2.5.0.tar.gz && \
cd pngquant-2.5.0 && \
make && \
make install
RUN apt-get install -y imagemagick libgraphicsmagick1-dev libmagickwand-dev perlmagick libmagick++-6-headers libmagick++-dev
ENV MAGICK_CONFIG=/usr/bin/GraphicsMagickWand-config
RUN cd && wget https://github.com/rflynn/imgmin/archive/v1.1.tar.gz && \
tar xf v1.1.tar.gz && \
cd imgmin-1.1 && \
autoreconf -fi && \
./configure && \
make && \
make install
You can build the image with docker build -t thumbor . when in a dir with the Dockerfile above.
It will fail but you can still shell in with docker run -t -i thumbor /sbin/my_init -- bash -l. After you shell in you'd probably want to rerun imgmin build step (it fails so it won't be in the image) with cd /root && wget https://github.com/rflynn/imgmin/archive/v1.1.tar.gz && \ tar xf v1.1.tar.gz && \ cd imgmin-1.1 && \ export MAGICK_CONFIG=/usr/bin/GraphicsMagickWand-config && autoreconf -fi && \ ./configure && \ make && \ make install
Would appreciate any help. Thanks.