From fdc85645f99aa410862a5b12dd7c1780a96a3676 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 29 May 2015 14:50:21 +1000 Subject: [PATCH] Update base image * include all image_optim dependencies * upgrade jemalloc --- image/base/Dockerfile | 37 +++++++++++++++++++++++++------------ image/base/install-gifsicle | 11 +++++++++++ image/base/install-pngcrush | 10 ++++++++++ image/base/install-pngquant | 11 +++++++++++ 4 files changed, 57 insertions(+), 12 deletions(-) create mode 100755 image/base/install-gifsicle create mode 100755 image/base/install-pngcrush create mode 100755 image/base/install-pngquant diff --git a/image/base/Dockerfile b/image/base/Dockerfile index 647ca8b..9cfb769 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -2,7 +2,7 @@ # When new LTS ships we can upgrade # NAME: discourse_base -# VERSION: 1.0.11 +# VERSION: 1.0.12 FROM ubuntu:14.04 @@ -28,7 +28,6 @@ RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections &&\ libxslt-dev libcurl4-openssl-dev \ libssl-dev libyaml-dev libtool \ libxml2-dev gawk \ - pngcrush gifsicle \ postgresql-9.3 postgresql-client-9.3 \ postgresql-contrib-9.3 libpq-dev libreadline-dev \ nginx language-pack-en sudo cron anacron \ @@ -39,27 +38,41 @@ RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections &&\ sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl" &&\ apt-get -y install redis-server haproxy openssh-server &&\ cd / &&\ - mkdir /jemalloc && cd /jemalloc &&\ - wget http://www.canonware.com/download/jemalloc/jemalloc-3.4.1.tar.bz2 &&\ - tar -xjf jemalloc-3.4.1.tar.bz2 && cd jemalloc-3.4.1 && ./configure && make &&\ - mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc &&\ apt-get -y install runit monit socat &&\ mkdir -p /etc/runit/1.d &&\ apt-get clean &&\ rm -f /etc/apt/apt.conf.d/40proxy &&\ locale-gen en_US &&\ - wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ - tar -xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ - rm phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ - cp phantomjs-1.9.8-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ - rm -fr phantomjs-1.9.8-linux-x86_64 &&\ wget http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux.tar.gz &&\ tar -xf pngout-20150319-linux.tar.gz &&\ rm pngout-20150319-linux.tar.gz &&\ cp pngout-20150319-linux/x86_64/pngout /bin/pngout &&\ rm -rf pngout-20150319-linux &&\ apt-get install -y nodejs &&\ - npm install uglify-js -g + npm install uglify-js -g &&\ + npm install svgo -g &&\ + apt-get -y install advancecomp jhead jpegoptim libjpeg-progs optipng + +# TODO check when binary packages are ready (not yet) +RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ + tar -xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ + rm phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ + cp phantomjs-1.9.8-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ + rm -fr phantomjs-1.9.8-linux-x86_64 + +RUN mkdir /jemalloc && cd /jemalloc &&\ + wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 &&\ + 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 + +ADD install-pngcrush /tmp/install-pngcrush +RUN /tmp/install-pngcrush + +ADD install-gifsicle /tmp/install-gifsicle +RUN /tmp/install-gifsicle + +ADD install-pngquant /tmp/install-pngquant +RUN /tmp/install-pngquant ADD install-imagemagick /tmp/install-imagemagick RUN /tmp/install-imagemagick diff --git a/image/base/install-gifsicle b/image/base/install-gifsicle new file mode 100755 index 0000000..17d8af9 --- /dev/null +++ b/image/base/install-gifsicle @@ -0,0 +1,11 @@ +#!/bin/bash +VERSION=1.87 +cd /tmp +curl -O http://www.lcdf.org/gifsicle/gifsicle-$VERSION.tar.gz +tar zxf gifsicle-$VERSION.tar.gz +cd gifsicle-$VERSION +./configure +make install +cd / +rm -fr /tmp/gifsicle-$PNGCRUSH_VERSION +rm /tmp/gifsicle-$PNGCRUSH_VERSION.tar.gz diff --git a/image/base/install-pngcrush b/image/base/install-pngcrush new file mode 100755 index 0000000..b6fa3e3 --- /dev/null +++ b/image/base/install-pngcrush @@ -0,0 +1,10 @@ +#!/bin/bash +PNGCRUSH_VERSION=1.7.85 +cd /tmp +curl -O http://iweb.dl.sourceforge.net/project/pmt/pngcrush/$PNGCRUSH_VERSION/pngcrush-$PNGCRUSH_VERSION.tar.gz +tar zxf pngcrush-$PNGCRUSH_VERSION.tar.gz +cd pngcrush-$PNGCRUSH_VERSION +make && cp -f pngcrush /usr/local/bin +cd / +rm -fr /tmp/pngcrush-$PNGCRUSH_VERSION +rm /tmp/pngcrush-$PNGCRUSH_VERSION.tar.gz diff --git a/image/base/install-pngquant b/image/base/install-pngquant new file mode 100755 index 0000000..852ebe0 --- /dev/null +++ b/image/base/install-pngquant @@ -0,0 +1,11 @@ +#!/bin/bash +VERSION=2.4.1 +cd /tmp +curl -O https://github.com/pornel/pngquant/archive/$VERSION.tar.gz +tar zxf $VERSION.tar.gz +cd pngquant-$VERSION +./configure +make && make install +cd / +rm -fr /tmp/pngq* +rm -fr /tmp/$VERSION* -- 2.25.1