Skip to content

Instantly share code, notes, and snippets.

@melo
Created August 14, 2015 05:00
Show Gist options
  • Save melo/dfe920fac19b6d38ab64 to your computer and use it in GitHub Desktop.
Save melo/dfe920fac19b6d38ab64 to your computer and use it in GitHub Desktop.
Simple Dockerfile base for Perl project
FROM our/base
COPY *.patch /build/
## Replicate std perl image but on top of our base image
RUN cd /build \
&& mkdir src \
&& curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.20.2.tar.bz2 -o perl-5.20.2.tar.bz2 \
&& echo '63126c683b4c79c35008a47d56f7beae876c569f *perl-5.20.2.tar.bz2' | sha1sum -c - \
&& tar --strip-components=1 -xjf perl-5.20.2.tar.bz2 -C src \
&& rm perl-5.20.2.tar.bz2 \
&& cd src \
&& cat *.patch | patch -p1 \
&& ./Configure -Duse64bitall -des -Dprefix='/usr/bin' \
&& make -j4 \
&& make test_harness \
&& make install \
&& cd /build \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr ./cpanm /root/.cpanm /build/src /build/*patch
## Install Carton, our bootstrap system
RUN ["cpanm", "-q", "-n", "Carton"]
ENTRYPOINT ["/base/start.pl", "carton", "exec"]
### Things all our Perl apps will do
ONBUILD COPY cpanfile cpanfile.snapshot /build/
ONBUILD RUN cd /build && carton install
ONBUILD COPY . /build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment