shrink built images by ~100M

This commit is contained in:
Arthur Axel 'fREW' Schmidt 2015-01-30 10:02:04 -06:00
parent c7af0df2f1
commit e1dda05071
5 changed files with 65 additions and 75 deletions

View file

@ -1,7 +1,9 @@
FROM buildpack-deps
MAINTAINER Peter Martini <PeterCMartini@GMail.com>
RUN apt-get update && apt-get install -y curl procps
RUN apt-get update \
&& apt-get install -y curl procps \
&& rm -fr /var/lib/apt/lists/*
RUN mkdir /usr/src/perl
WORKDIR /usr/src/perl
@ -10,20 +12,16 @@ COPY sha1.txt /tmp/sha1.txt
RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.18.4.tar.bz2 -o perl-5.18.4.tar.bz2 \
&& sha1sum -c /tmp/sha1.txt \
&& tar --strip-components=1 -xjf perl-5.18.4.tar.bz2 -C /usr/src/perl \
&& rm perl-5.18.4.tar.bz2 /tmp/sha1.txt
RUN ./Configure -Dusethreads -Duse64bitall -A ccflags=-fwrapv -des \
&& rm perl-5.18.4.tar.bz2 /tmp/sha1.txt \
&& ./Configure -Dusethreads -Duse64bitall -A ccflags=-fwrapv -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& make veryclean
WORKDIR /usr/src
RUN curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr /root/.cpanm \
&& rm ./cpanm
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
WORKDIR /root

View file

@ -1,7 +1,9 @@
FROM buildpack-deps
MAINTAINER Peter Martini <PeterCMartini@GMail.com>
RUN apt-get update && apt-get install -y curl procps
RUN apt-get update \
&& apt-get install -y curl procps \
&& rm -fr /var/lib/apt/lists/*
RUN mkdir /usr/src/perl
WORKDIR /usr/src/perl
@ -10,20 +12,16 @@ COPY sha1.txt /tmp/sha1.txt
RUN curl -SL https://cpan.metacpan.org/authors/id/R/RJ/RJBS/perl-5.18.4.tar.bz2 -o perl-5.18.4.tar.bz2 \
&& sha1sum -c /tmp/sha1.txt \
&& tar --strip-components=1 -xjf perl-5.18.4.tar.bz2 -C /usr/src/perl \
&& rm perl-5.18.4.tar.bz2 /tmp/sha1.txt
RUN ./Configure -Duse64bitall -A ccflags=-fwrapv -des \
&& rm perl-5.18.4.tar.bz2 /tmp/sha1.txt \
&& ./Configure -Duse64bitall -A ccflags=-fwrapv -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& make veryclean
WORKDIR /usr/src
RUN curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr /root/.cpanm \
&& rm ./cpanm
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
WORKDIR /root

View file

@ -1,7 +1,9 @@
FROM buildpack-deps
MAINTAINER Peter Martini <PeterCMartini@GMail.com>
RUN apt-get update && apt-get install -y curl procps
RUN apt-get update \
&& apt-get install -y curl procps \
&& rm -fr /var/lib/apt/lists/*
RUN mkdir /usr/src/perl
WORKDIR /usr/src/perl
@ -10,20 +12,16 @@ COPY sha1.txt /tmp/sha1.txt
RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.20.1.tar.bz2 -o perl-5.20.1.tar.bz2 \
&& sha1sum -c /tmp/sha1.txt \
&& tar --strip-components=1 -xjf perl-5.20.1.tar.bz2 -C /usr/src/perl \
&& rm perl-5.20.1.tar.bz2 /tmp/sha1.txt
RUN ./Configure -Dusethreads -Duse64bitall -des \
&& rm perl-5.20.1.tar.bz2 /tmp/sha1.txt \
&& ./Configure -Dusethreads -Duse64bitall -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& make veryclean
WORKDIR /usr/src
RUN curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr /root/.cpanm \
&& rm ./cpanm
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
WORKDIR /root

View file

@ -1,7 +1,9 @@
FROM buildpack-deps
MAINTAINER Peter Martini <PeterCMartini@GMail.com>
RUN apt-get update && apt-get install -y curl procps
RUN apt-get update \
&& apt-get install -y curl procps \
&& rm -fr /var/lib/apt/lists/*
RUN mkdir /usr/src/perl
WORKDIR /usr/src/perl
@ -10,20 +12,16 @@ COPY sha1.txt /tmp/sha1.txt
RUN curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.20.1.tar.bz2 -o perl-5.20.1.tar.bz2 \
&& sha1sum -c /tmp/sha1.txt \
&& tar --strip-components=1 -xjf perl-5.20.1.tar.bz2 -C /usr/src/perl \
&& rm perl-5.20.1.tar.bz2 /tmp/sha1.txt
RUN ./Configure -Duse64bitall -des \
&& rm perl-5.20.1.tar.bz2 /tmp/sha1.txt \
&& ./Configure -Duse64bitall -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& make veryclean
WORKDIR /usr/src
RUN curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr /root/.cpanm \
&& rm ./cpanm
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
WORKDIR /root

View file

@ -109,7 +109,9 @@ __DATA__
FROM buildpack-deps
MAINTAINER Peter Martini <PeterCMartini@GMail.com>
RUN apt-get update && apt-get install -y curl procps
RUN apt-get update \
&& apt-get install -y curl procps \
&& rm -fr /var/lib/apt/lists/*
RUN mkdir /usr/src/perl
WORKDIR /usr/src/perl
@ -118,20 +120,16 @@ COPY sha1.txt /tmp/sha1.txt
RUN curl -SL https://cpan.metacpan.org/authors/id/{{pause}}/perl-{{version}}.tar.bz2 -o perl-{{version}}.tar.bz2 \
&& sha1sum -c /tmp/sha1.txt \
&& tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \
&& rm perl-{{version}}.tar.bz2 /tmp/sha1.txt
RUN ./Configure {{args}} {{extra_flags}} -des \
&& rm perl-{{version}}.tar.bz2 /tmp/sha1.txt \
&& ./Configure {{args}} {{extra_flags}} -des \
&& make -j$(nproc) \
&& TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& make veryclean
WORKDIR /usr/src
RUN curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr /root/.cpanm \
&& rm ./cpanm
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
WORKDIR /root