Skip to content

Commit

Permalink
Try out building with alpine image
Browse files Browse the repository at this point in the history
Adapted from @ncopa's example in Perl#23 .
  • Loading branch information
zakame committed Apr 9, 2016
1 parent 30e529b commit 2dc8077
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
12 changes: 12 additions & 0 deletions alpine/DevelPatchPerl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/patchlevel.h b/patchlevel.h
index bd56612..3d5f668 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -137,6 +137,7 @@ static const char * const local_patches[] = {
,"uncommitted-changes"
#endif
PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */
+ ,"Devel::PatchPerl 1.38"
,NULL
};

33 changes: 33 additions & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM alpine:latest
MAINTAINER Peter Martini <[email protected]>

RUN mkdir -p /usr/src/perl
COPY *.patch /usr/src/perl/
WORKDIR /usr/src/perl

ENV PERL_CPANM_OPT --no-wget

RUN set -x \
&& NPROC=$(getconf _NPROCESSORS_ONLN) \
&& apk add --no-cache curl procps tar build-base \
&& curl -SL https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.22.1.tar.bz2 -o perl-5.22.1.tar.bz2 \
&& echo '29f9b320b0299577a3e1d02e9e8ef8f26f160332 *perl-5.22.1.tar.bz2' | sha1sum -c - \
&& tar --strip-components=1 -xjf perl-5.22.1.tar.bz2 -C /usr/src/perl \
&& rm perl-5.22.1.tar.bz2 \
&& cat *.patch | patch -p1 \
&& ./Configure -Duse64bitall -Duseshrplib -des \
&& sed -i -e "s,\(d_setlocale=\)'define',\1'undef',g" ./config.sh \
&& ./Configure -S \
&& install -m0644 ./config.sh ./xconfig.sh \
&& make -j$NPROC \
&& TEST_JOBS=$NPROC make test_harness \
&& make install \
&& cd /usr/src \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl /tmp/*

WORKDIR /root

CMD ["perl5.22.1","-de0"]

0 comments on commit 2dc8077

Please sign in to comment.