20. Februar 2021 um 13:55 Uhr - Views: 416 #10915Dmitry PopovTeilnehmer
Hello everyone. I have a specialized module that I transfer from OTRS. The module is correctly installed on OTOBO, but it requires specialized Perl libraries, such as:AnyEvent, IO::Interactive module, Math::Random::Secure module, Crypt::PasswdMD5. Unfortunately, my knowledge of docker is initial, but I was able to load the shell from there, but I can’t install anything, because I don’t have a root inside the conrainer. Judging by my observations, there are root and otobo users inside the container, I am logged in under otobo, which does not have root rights. sudo is not installed in this image. Who can tell me how to install the perl libraries inside the image?
21. Februar 2021 um 11:13 Uhr #10916besTeilnehmer
adding new Perl modules to a container would essentially mean to create a new Docker image. This is feasible, but the recommendation is to go an easier route. Modules can be installed within _/opt/otobo_, which is a volume that lives outside the Docker container. CPAN modules can be installed as the user otobo.
On the Docker host you can log in as otobo with the command:
docker exec -it otobo_web_1 bash
The environment variable
PERL5LIBis preset there.
bes:~/devel/OTOBO/otobo (rel-10_0)$ docker exec -it otobo_web_1 bash
otobo@a1a51661d02f:~$ echo $PERL5LIB
otobo@a1a51661d02f:~$ ls -l local
ls: cannot access 'local': No such file or directory
The location _/opt/otobo_install/local/lib/perl5_ is used for the CPAN modules that are delivered with the image. _/opt/otobo/local/lib/perl5_ does initially not exist, but is intended for locally added modules.
Install module from CPAN, or maybe from a local Pinto repository, with using
otobo@a1a51661d02f:~$ cpanm -l local Acme::123
--> Working on Acme::123
Fetching http://www.cpan.org/authors/id/N/NA/NATHANM/Acme-123-0.04.zip ... OK
Configuring Acme-123-0.04 ... OK
Building and testing Acme-123-0.04 ... OK
Successfully installed Acme-123-0.04
1 distribution installed
otobo@a1a51661d02f:~$ perldoc -l Acme::123
Please tell us whether this worked for you, as I haven’t really used this feature myself.This info should also be included in the documentation. I have created the issue https://github.com/RotherOSS/doc-otobo-dev/issues/5 for that.
24. Februar 2021 um 0:34 Uhr #10947Dmitry PopovTeilnehmer
I’ve tried various methods, including this one https://doc.otobo.org/manual/installation/stable/en/content/installing-perl-modules.html , starting with the words “ Special care must be taken when OTOBO runs within Docker…“. This method helped partially, not all modules can be installed. I gave up on the idea of using docker, it is good for me for tests, in production, with a lot of integrations, it adds unsolvable difficulties. Thank you
25. Februar 2021 um 16:44 Uhr #10953besTeilnehmer
do you have an example of a module that can’t be installed? Out of curiosity I tried to install the modules mentioned in the initial post, and it seem to work seamlessly.
otobo@40d571709ab9:~$ cpanm -l local Crypt::PasswdMD5
--> Working on Crypt::PasswdMD5
Fetching http://www.cpan.org/authors/id/R/RS/RSAVAGE/Crypt-PasswdMD5-1.41.tgz ... OK
Configuring Crypt-PasswdMD5-1.41 ... OK
Building and testing Crypt-PasswdMD5-1.41 ... OK
Successfully installed Crypt-PasswdMD5-1.41
1 distribution installed
otobo@40d571709ab9:~$ perldoc -l Crypt::PasswdMD5
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.