Giter VIP home page Giter VIP logo

alpine-perl's People

Contributors

krumeich avatar scottw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

alpine-perl's Issues

loadable library and perl binaries are mismatched

SSLeay.c: loadable library and perl binaries are mismatched (got handshake key 0xce00080, needed 0xcd00080)

Hi, I am getting this error message since my last image build.

Dockerfile:

FROM scottw/alpine-perl:latest

ENV PERL5LIB "/usr/share/perl5/vendor_perl:/usr/lib/perl5/vendor_perl"

RUN mkdir -p /docker
COPY /docker /docker

RUN chmod +x /docker/initialize.sh && /docker/initialize.sh

CMD ["/bin/bash"]

initialize.sh shell script:

#! /bin/sh

echo "Base upgrade OS"
apk update
#apk upgrade

echo "Add bash and openssl"
apk add bash
apk add openssl

echo "Add required perl modules"
apk add perl-yaml-tiny
apk add perl-net-ssleay
apk add perl-io-socket-ssl
cpanm -n GitLab::API::v4

echo "Add vendor modules to PERL5LIB"
echo "export PERL5LIB=$PERL5LIB" >> /root/.bashrc

My perl skript uses GitLab::API::v4, and this SSL connect fails now with the error mentioned above.

Resulting containers are unnecessarily large

Hey, thanks for providing this. However, your images end up being about 5 times as large as they need to be due to keeping all the build gubbins around. If you put Perl in its own directory, it can be lifted as a build artifact into a second build target in the Dockerfile.

Here's what I'm using (which is heavily influenced by you). It ends up with (including DBD::mysql) a container size of 62MB as compared to 331MB for yours (again, with DBD::mysql added).

All you need to do is put perl in a single place, and all your users can use the same trick for much smaller containers if they want to, or can just keep doing what they're doing if they don't add a second build step.

FROM alpine AS perlbuild

## alpine curl and wget aren't fully compatible, so we install them
## here. gnupg is needed for Module::Signature.
RUN apk update && apk upgrade && apk add curl tar make gcc build-base wget gnupg

RUN mkdir -p /usr/src/perl

WORKDIR /usr/src/perl

## from perl; `true make test_harness` because 3 tests fail
## some flags from http://git.alpinelinux.org/cgit/aports/tree/main/perl/APKBUILD?id=19b23f225d6e4f25330e13144c7bf6c01e624656
RUN curl -SLO https://www.cpan.org/src/5.0/perl-5.30.0.tar.gz \
    && echo 'aa5620fb5a4ca125257ae3f8a7e5d05269388856 *perl-5.30.0.tar.gz' | sha1sum -c - \
    && tar --strip-components=1 -xzf perl-5.30.0.tar.gz -C /usr/src/perl \
    && rm perl-5.30.0.tar.gz \
    && ./Configure -des \
        -Duse64bitall \
        -Dcccdlflags='-fPIC' \
        -Dcccdlflags='-fPIC' \
        -Dccdlflags='-rdynamic' \
        -Dlocincpth=' ' \
        -Duselargefiles \
        -Dusethreads \
        -Duseshrplib \
        -Dd_semctl_semun \
        -Dusenm \
        -Dprefix=/opt/perl \
    && make libperl.so \
    && make -j$(nproc) \
    && true TEST_JOBS=$(nproc) make test_harness \
    && make install

RUN rm -Rf /usr/src/perl
WORKDIR /opt/perl/
ENV PATH "/opt/perl/bin:$PATH"

# Grab cpanm, executable only
WORKDIR /tmp/
RUN curl -L https://cpanmin.us/ -o cpanm && chmod +x cpanm && ln -s /tmp/cpanm /usr/bin/cpanm

# INSTALL YOUR DEPS AND SHIT HERE
RUN apk add mysql-dev
RUN cpanm DBD::mysql

# This builds the smaller image without all the build-time junk
FROM alpine AS production
# Grab the Perl modules
COPY --from=perlbuild /opt/perl/ /opt/perl/
# Grab any system libraries you needed
RUN apk add mariadb-connector-c
ENV PATH "/opt/perl/bin:$PATH"

Fix for the Time-Piece failed tests

This command patches the Time-Piece tests with the extended timezone EST5EDT4 definition:

sed 's!"EST5EDT4"!"EST5EDT4,M4.1.0/02:00:00,M10-5-0/02:00"!' \
  -i cpan/Time-Piece/t/02core_dst.t

Then the test passes:

./perl -I lib cpan/Time-Piece/t/02core_dst.t

as well as the whole Perl tests:

make test_harness

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.