Installing RT Dependencies in Docker

Good day,

I have followed the README at README - RT 5.0.7 Documentation - Best Practical, to try to get the installation working correctly within a Docker setup. I am not sure if it makes any difference but I am doing this as a Docker installation on a Mac M2.

I have ended up with a Dockerfile that manually lists out all the dependencies as well to try to narrow down what is actually preventing the image from building. At the moment, it looks somewhat like this:

FROM arm64v8/perl:latest

Install dependencies

RUN apt-get update &&
apt-get install -y
build-essential
wget
tar
libssl-dev
libgd-dev
libexpat1-dev
libapache2-mod-perl2
libcgi-pm-perl
default-libmysqlclient-dev
gnupg
graphviz
libssl3
zlib1g
libgd3 libexpat1 libpq5 w3m elinks links html2text lynx openssl libgd-dev
libdbd-mysql-perl
git &&
apt-get clean

Then I pull the code and then:

RUN ./configure
–enable-externalauth
–enable-gd
–enable-gpg
–enable-graphviz
–enable-smime
–with-web-handler=standalone

Then I install the dependencies manually based on what RT says is missing, for example:

RUN cpanm -n Apache::Session
Business::Hours
CGI
CGI::Cookie
CGI::Emulate::PSGI
CGI::PSGI
And it lists them all.

The part that gets stuck is DBD::mysql. If I separate it out like this:

RUN cpanm -fnv DBD::mysql

It gives me the actual output, which is the following:

Configuring DBD-mysql-5.006 …

PLEASE NOTE:

For ‘make test’ to run properly, you must ensure that the

database user ‘’ can connect to your MySQL server

and has the proper privileges that these tests require such

as ‘drop table’, ‘create table’, ‘drop procedure’, ‘create procedure’

as well as others.

mysql> CREATE USER ‘’@‘localhost’ IDENTIFIED BY ‘s3kr1t’;

mysql> GRANT ALL PRIVILEGES ON test.* TO ‘’@‘localhost’;

You can also optionally set the user to run ‘make test’ with:

perl Makefile.PL --testuser=username

DBD::mysql requires MySQL 8.x for building. Version reported by mysql_config --version: 10.11.6 at Makefile.PL line 451, line 3.

! Configure failed for DBD-mysql-5.006. See /root/.cpanm/work/1718803649.7/build.log for details.

What I have noticed is that when you install the dependencies, it looks like the package tries to make a database connection to confirm that it works before it passes the installation process. It would’ve been great if there was a way to at least get the installation to complete on its own and then deal with the connections afterwards.

Is someone able to please help me figure out why it is unable to configure? I resorted to starting my database container manually so that it has something to connect to. In my RT_SiteConfig.pm file I’ve listed database credentials. I’ve listed the same credentials in my docker-compose.yml file as well. I don’t understand why it picks up the user as empty ‘’.

Please let me know if you need additional information. Thank you for your help in advance!

Hasn’t this package line already loaded DBD::mysql for you?

It should also be noted that back in December last year @Jim_Brandt noted that version 4.052 of the DBD::mysql CPAN package might be useful in this situation

Thanks GreenJimII!

That worked. Just for reference:

I removed “libdbd-mysql-perl” and instead in the section where I’m installing all the modules, i.e.

RUN cpanm -n Apache::Session
Business::Hours
CGI
CGI::Cookie
CGI::Emulate::PSGI
CGI::PSGI \

I added the following:
DBD::mysql@4.052

That allowed the installation and the checks to pass successfully.