# NAME: discourse_base
-# VERSION: 1.3.2
+# VERSION: 1.3.3
FROM ubuntu:16.04
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
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
# 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
./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 \
--with-tiff
make all && make install
+
cd $HOME
rm -rf $WDIR
ldconfig