From: Michael Brown Date: Thu, 14 Nov 2013 04:23:18 +0000 (+0000) Subject: Remove unnecessary tools in image to reduce size X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8c48d4f80d6c48503af2c5fed4b83dfc38f887d7;p=discourse_docker.git Remove unnecessary tools in image to reduce size * remove build tools after build complete * don't install gem docs --- diff --git a/image/Dockerfile b/image/Dockerfile index 8ebacb3..93d1ace 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -24,6 +24,7 @@ RUN apt-get -y update &&\ dpkg-divert --local --rename --add /sbin/initctl &&\ ln -s /bin/true /sbin/initctl &&\ apt-get install -y redis-server haproxy openssh-server &&\ + echo 'install: --no-ri --no-rdoc' >> ~/.gemrc (mkdir /src && cd /src &&\ git clone https://github.com/sstephenson/ruby-build.git) &&\ (cd /src/ruby-build && ./install.sh) &&\ @@ -36,16 +37,19 @@ RUN apt-get -y update &&\ git clone https://github.com/discourse/discourse.git &&\ chown -R discourse:discourse /var/www/discourse) &&\ (cd /var/www/discourse &&\ - sudo -u discourse RAILS4=1 bundle install --deployment) &&\ + sudo -u discourse RAILS4=1 bundle install --deployment \ + --without test --without development) &&\ + (cd /var/www/discourse/vendor/bundle &&\ + find . -name tmp -type d | xargs rm -rf) &&\ apt-get install -y runit &&\ locale-gen en_US &&\ - apt-get -y autoremove build-essential gcc &&\ + apt-get -y autoremove build-essential gcc gcc-4.7 .+-dev &&\ apt-get clean - apt-get install psmisc &&\ +RUN apt-get install psmisc &&\ (cd / && git clone https://github.com/SamSaffron/pups.git) &&\ apt-get clean -#RUN du -ksx / +RUN echo image size: $(du -hsx /) # RUN cd /var/www/discourse && bundle exec rake db:test:prepare && bundle exec rspec