From 71c3c6555c53ff5cd9069b58d9bf39f3b636db5f Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 23 May 2016 18:58:15 +1000 Subject: [PATCH] correct and validate image magick install --- image/base/Dockerfile | 25 ++++++++++++++----------- image/base/install-imagemagick | 7 +++++-- image/build.rb | 2 +- image/discourse/Dockerfile | 4 ++-- image/discourse_test/Dockerfile | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/image/base/Dockerfile b/image/base/Dockerfile index d8bbfee..eaa6d09 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -1,5 +1,5 @@ # NAME: discourse_base -# VERSION: 1.3.2 +# VERSION: 1.3.3 FROM ubuntu:16.04 @@ -57,9 +57,22 @@ RUN mkdir /jemalloc && cd /jemalloc &&\ tar -xjf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 && ./configure && make &&\ mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc +RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ + mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ + cd /src/ruby-build && ./install.sh &&\ + cd / && rm -rf /src/ruby-build && ruby-build 2.3.1 /usr/local + +RUN gem install bundler &&\ + rm -rf /usr/local/share/ri/2.3.0/system &&\ + cd / && git clone https://github.com/SamSaffron/pups.git + ADD install-imagemagick /tmp/install-imagemagick RUN /tmp/install-imagemagick +# Validate install +RUN ruby -e "v='`convert -version`'; ['png','gif','tiff','jpeg','freetype'].each{ |f| ((STDERR.puts('no ' + f + ' support in imagemagick')); exit(-1)) unless v.include?(f)}" + +# ADD install-pngcrush /tmp/install-pngcrush RUN /tmp/install-pngcrush @@ -69,17 +82,7 @@ RUN /tmp/install-gifsicle ADD install-pngquant /tmp/install-pngquant RUN /tmp/install-pngquant -RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ - mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ - cd /src/ruby-build && ./install.sh &&\ - cd / && rm -rf /src/ruby-build && ruby-build 2.3.1 /usr/local - -RUN gem install bundler &&\ - rm -rf /usr/local/share/ri/2.3.0/system &&\ - cd / && git clone https://github.com/SamSaffron/pups.git - RUN cd tmp && wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 - RUN cd tmp && tar jxf phantomjs-2.1.1-linux-x86_64.tar.bz2 && mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin # clean up for docker squash diff --git a/image/base/install-imagemagick b/image/base/install-imagemagick index 10f92c6..8be617c 100755 --- a/image/base/install-imagemagick +++ b/image/base/install-imagemagick @@ -3,7 +3,7 @@ set -o errexit # Install build deps apt-get -y -q remove imagemagick -apt-get -y -q install ghostscript gsfonts autoconf libbz2-dev libjpeg-dev libtiff-dev libfreetype6-dev +apt-get -y -q install ghostscript gsfonts pkg-config autoconf libbz2-dev libjpeg-dev libtiff-dev libfreetype6-dev PREFIX=/usr/local WDIR=/tmp/imagemagick @@ -16,12 +16,14 @@ cd $WDIR/libpng ./configure --prefix=$PREFIX make all && make install + + # Build and install ImageMagick wget -O $WDIR/ImageMagick.tar.gz "http://www.imagemagick.org/download/ImageMagick-6.9.4-4.tar.gz" IMDIR=$WDIR/$(tar tzf $WDIR/ImageMagick.tar.gz --wildcards "ImageMagick-*/configure" |cut -d/ -f1) tar zxf $WDIR/ImageMagick.tar.gz -C $WDIR cd $IMDIR -LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./configure \ +PKG_CONF_LIBDIR=$PREFIX/lib LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./configure \ --prefix=$PREFIX \ --enable-static \ --enable-bounds-checking \ @@ -42,6 +44,7 @@ LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./configure \ --with-tiff make all && make install + cd $HOME rm -rf $WDIR ldconfig diff --git a/image/build.rb b/image/build.rb index aa4398d..03f2e2b 100644 --- a/image/build.rb +++ b/image/build.rb @@ -2,7 +2,7 @@ # require 'pty' -$version = "1.3.2" +$version = "1.3.3" $docker_squash = "https://github.com/jwilder/docker-squash/releases/download/v0.2.0/docker-squash-linux-amd64-v0.2.0.tar.gz" diff --git a/image/discourse/Dockerfile b/image/discourse/Dockerfile index 865b961..23dee6f 100644 --- a/image/discourse/Dockerfile +++ b/image/discourse/Dockerfile @@ -1,5 +1,5 @@ -# Current version 1.3.2 -FROM discourse/base:1.3.2 +# Current version 1.3.3 +FROM discourse/base:1.3.3 MAINTAINER Sam Saffron "https://twitter.com/samsaffron" diff --git a/image/discourse_test/Dockerfile b/image/discourse_test/Dockerfile index 99e26cd..e98255a 100644 --- a/image/discourse_test/Dockerfile +++ b/image/discourse_test/Dockerfile @@ -1,4 +1,4 @@ -FROM discourse/discourse:1.3.2 +FROM discourse/discourse:1.3.3 MAINTAINER Sam Saffron "https://twitter.com/samsaffron" -- 2.25.1