How can I update Perl module to handle while maintaining the Dockers image?

I'm working on creating the image of dockers to be able to run all of our Perl applications. For hundreds of applications you want to install CPAN modules. Complete assembly image docker takes about an hour.

After the initial image I'm not sure how to best handle the current update.

  • We could save one Docker file in git, and then modify it as necessary, and press the new assembly to dockerhub. However, if the person performing the assembly does not have all the intermediate images, the addition of a CPAN module can be a very tedious process and it can take an hour, before they even find out if a new module is installed correctly. In addition, it will load every CPAN module again, it seems a bit risky as the new module violation may occur.

  • Alternatively, the person doing the assembly, can pull the last image docking hub, and then interactively install cpan module to fix the assembly and push the new image on the docker hub. However, while we have only our image dockerhub, but not Dockerfile master.

  • Or another option is to create a file Docker for each new assembly, which refers to the previous image docking Hober. It seems too complicated, though.

Option 1) seems wrong. I am sure that we do not want to rebuild the entire image of the base OS to install only one additional module. However, depending on the image without Dockerfiles also seems risky.

+5
source share
1 answer

You can use the standard installer module to your base OS image on your Dockers.

For example, if it uses RedHat yum and uses CPAN only when they are available

FROM centos:centos7 RUN yum -y install cpanm gcc perl perl-App-cpanminus perl-Config-Tiny && yum clean all RUN cpanm install Some::Module; rm -fr root/.cpanm; exit 0 

It is taken from here and change

I tried to get the base image that is used in real-world applications

I would also like to avoid doing things in an interactive mode (for example, script file docker), because you want to be able to repeat the assembly when the flow changes up change, which docker makes hub for you.


CHANGE you can convert perl modules into their own packages using dh-make-perl

You can download them into your own Ubuntu repo using reprepro or paid solution Artifactory

Then they can be installed using apt-get, when you use your repo as a source of docker file.

When I tried the same thing in front of There are several problems

  • Your applications do not work with the latest version of the module.
  • There are far more dependent than you expected
  • Some modules are not packed

Benefits

  • You keep the assembly tools (gcc, etc.) with application servers.
  • You know much more about its dependencies.
+1
source

All Articles