-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,295 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,38 @@ | ||
FROM centos:centos6 | ||
FROM centos:centos6 as builder | ||
|
||
RUN yum install -y gcc make tar curl patch bzip2 xz && \ | ||
rm -rf /var/cache/yum/* && \ | ||
yum clean all | ||
RUN mkdir /tmp/build /artifact | ||
RUN curl -fsSL https://github.com/skaji/relocatable-perl/releases/download/5.26.2.0/perl-x86_64-linux.tar.gz | tar xzf - --strip-components 1 -C /usr/local | ||
RUN yum install -y \ | ||
gcc \ | ||
make \ | ||
tar \ | ||
curl \ | ||
patch \ | ||
xz | ||
RUN mkdir -p \ | ||
/lib \ | ||
/lib/x86_64-linux-gnu \ | ||
/lib64 \ | ||
/usr/lib \ | ||
/usr/lib/x86_64-linux-gnu \ | ||
/usr/lib64 \ | ||
/usr/local/lib \ | ||
/usr/local/lib64 | ||
RUN curl -fsSL https://git.io/perl-install | bash -s /perl | ||
COPY relocatable-perl-build BUILD_VERSION / | ||
RUN /perl/bin/perl /relocatable-perl-build --perl_version $(cat /BUILD_VERSION) --prefix /opt/perl | ||
RUN curl -fsSL https://git.io/cpm | /opt/perl/bin/perl - install -g App::cpanminus App::ChangeShebang | ||
RUN /opt/perl/bin/change-shebang -f /opt/perl/bin/* | ||
RUN cp -r /opt/perl /tmp/perl-x86_64-linux | ||
RUN set -eux; \ | ||
cd /tmp; \ | ||
tar cf perl-x86_64-linux.tar perl-x86_64-linux; \ | ||
gzip -9 --stdout perl-x86_64-linux.tar > /perl-x86_64-linux.tar.gz; \ | ||
xz -9 --stdout perl-x86_64-linux.tar > /perl-x86_64-linux.tar.xz; \ | ||
true | ||
|
||
RUN /usr/local/bin/perl -e 'mkdir $_ for grep !-d, @ARGV' /usr/local/lib64 /usr/local/lib /lib/x86_64-linux-gnu /lib64 /lib /usr/lib/x86_64-linux-gnu /usr/lib64 /usr/lib | ||
|
||
ADD relocatable-perl-build /tmp/build/relocatable-perl-build | ||
ADD BUILD_VERSION /tmp/build/BUILD_VERSION | ||
RUN /usr/local/bin/perl /tmp/build/relocatable-perl-build --perl_version `cat /tmp/build/BUILD_VERSION` --prefix /opt/perl && \ | ||
curl --compressed -fsSL https://git.io/cpm | /opt/perl/bin/perl - install -g App::cpanminus App::ChangeShebang && \ | ||
rm -rf ~/.perl-cpm && \ | ||
/opt/perl/bin/change-shebang -f /opt/perl/bin/* && \ | ||
cp -r /opt/perl /tmp/perl-x86_64-linux && \ | ||
cd /tmp && \ | ||
tar cf perl-x86_64-linux.tar perl-x86_64-linux && \ | ||
gzip -9 --stdout perl-x86_64-linux.tar > /artifact/perl-x86_64-linux.tar.gz && \ | ||
xz -9 --stdout perl-x86_64-linux.tar > /artifact/perl-x86_64-linux.tar.xz && \ | ||
rm -rf /tmp/perl-x86_64-linux* | ||
|
||
CMD ["sleep", "infinity"] | ||
FROM alpine | ||
COPY --from=builder /perl-x86_64-linux.tar.gz /perl-x86_64-linux.tar.gz | ||
COPY --from=builder /perl-x86_64-linux.tar.xz /perl-x86_64-linux.tar.xz | ||
# ID=$(docker create skaji/relocatable-perl) | ||
# docker cp $ID:/perl-x86_64-linux.tar.gz . | ||
# docker cp $ID:/perl-x86_64-linux.tar.xz . | ||
# docker rm $ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.