Icinga / docker-icingaweb2

GNU General Public License v2.0
15 stars 11 forks source link

PDF/CSV export #115

Open sebek72 opened 1 year ago

sebek72 commented 1 year ago

I am having issues with PDF export on icingaweb2 pages (does not work out of the box). Enabling the PDFexport module google-chrome is needed in the docker image. Can this be added as default to the Dockerfile?

Dokerfile diff `-RUN ["bash", "-exo", "pipefail", "-c", "export DEBIAN_FRONTEND=noninteractive; apt-get update; apt-get install --no-install-{recommends,suggests} -y apache2 ca-certificates libapache2-mod-php7.4 libldap-common locales-all php-{imagick,redis} php7.4-{bcmath,bz2,common,curl,dba,enchant,gd,gmp,imap,interbase,intl,json,ldap,mbstring,mysql,odbc,opcache,pgsql,pspell,readline,snmp,soap,sqlite3,sybase,tidy,xml,xmlrpc,xsl,zip}; apt-get clean; rm -vrf /var/lib/apt/lists/*"]

+RUN ["bash", "-exo", "pipefail", "-c", "export DEBIAN_FRONTEND=noninteractive; apt-get update; apt-get install --no-install-{recommends,suggests} -y wget apache2 ca-certificates libapache2-mod-php7.4 libldap-common locales-all php-{imagick,redis} php7.4-{bcmath,bz2,common,curl,dba,enchant,gd,gmp,imap,interbase,intl,json,ldap,mbstring,mysql,odbc,opcache,pgsql,pspell,readline,snmp,soap,sqlite3,sybase,tidy,xml,xmlrpc,xsl,zip}; wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb; apt-get install --no-install-recommends -y ./google-chrome-stable_current_amd64.deb; rm google-chrome-stable_current_amd64.deb; apt-get clean; rm -vrf /var/lib/apt/lists/*"]`

The downside is that the image size jumps from around 700MB to 1.1GB

Al2Klimov commented 1 year ago

Hi,

Does Chromium work as well for you?

sebek72 commented 1 year ago

Does not reduce the image size.

sebek72 commented 9 months ago

Now another issue is the CVS export runs out of memory. Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /usr/share/icinga-php/ipl/vendor/composer/ClassLoader.php on line 576

sebek72 commented 9 months ago

Problem solved by increasing the memory_limit to 256M in docker container php config. Another problem persists: https://github.com/Icinga/icingadb-web/issues/972

Al2Klimov commented 6 months ago

Pro: the module starts the browser by itself, so it has to be in the same image

Cons:

FROM icinga/icingaweb2
USER root
RUN ["bash", "-exo", "pipefail", "-c", "export DEBIAN_FRONTEND=noninteractive; apt-get update; apt-get install --no-install-{recommends,suggests} -y chromium; apt-get clean; rm -vrf /var/lib/apt/lists/*"]
USER www-data