Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Perl DBD::mysql module and Pipelines

mgoodnight
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2018

Decided to try out a Perl project with Bitbucket Pipelines and deploy it to an EC2 running Ubuntu Xenial in AWS using the perl:5.26 Docker Hub image. This is also my first time using Docker as well. All goes well except when I try to start the PSGI I get the following:

Can't load application from file "/var/www/production-1534349533/script/testproject": Can't load '/var/www/production-1534349533/script/../local/lib/perl5/x86_64-linux-gnu/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmariadbclient.so.18: cannot open shared object file: No such file or directory at /home/ubuntu/perl5/perlbrew/perls/perl-5.26.0/lib/5.26.0/x86_64-linux/DynaLoader.pm line 193. at /var/www/production-1534349533/local/lib/perl5/Mojo/mysql/Database.pm line 5.

Some googling revealed a few of possible solutions that involved updating a symlink or purging, installing/reinstalling MariaDB to utilize their MySQL drivers, or install this library (which seems to have dropped off the map in the apt-get repos). Instead I deleted my local directory and run my dependency pipeline command on the EC2 instead:

cpanm -nvL local --installdeps .


Try firing up the PSGI again and now it works! So this leads me to building my own image for Pipelines to use base images of ubuntu:xenial and perl:5.26 to see this solves the problem and I still get the same error as mentioned above. Any thoughts on what would be different between my Xenial image and my Xenial EC2 instance when trying to run PSGI? I'm on the fence on whether this is a lack of understanding of the compiler and library requirements of DBD::mysql or of Docker. Any help on this is greatly appreciated!


Dockerfile of my custom image mentioned above:

FROM ubuntu:16.04
RUN apt-get update
RUN apt-get -q -y install build-essential
RUN apt-get -q -y install libxml2
RUN apt-get -q -y install libxml2-dev
RUN apt-get -q -y install libmysqlclient-dev
RUN apt-get -q -y install libexpat1-dev
RUN apt-get -q -y install libssl-dev
RUN apt-get -q -y install libnet-ssleay-perl
RUN apt-get -q -y install git-core

FROM perl:5.26
RUN cpanm -nv local::lib Dist::Zilla Dist::Zilla::Plugin::FakeRelease +Dist::Zilla::Plugin::Git::NextVersion Dist::Zilla::Plugin::PkgVersion+ Dist::Zilla::Plugin::Prereqs Dist::Zilla::Plugin::PruneFiles Dist::Z+illa::PluginBundle::Filter Dist::Zilla::PluginBundle::Git

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events