RotherOSS / otobo

OTOBO is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. https://otobo.io/
GNU General Public License v3.0
240 stars 72 forks source link

Reduce size of Docker image #3542

Open bschmalhofer opened 2 days ago

bschmalhofer commented 2 days ago

The OTOBO Docker image, used for the webserver and the daemon, is a bit bloated. https://hub.docker.com/layers/rotheross/otobo/devel-rel-11_1/images/sha256-8770c2aaa94330ee8b6f1fb511a0ab95e0218051c4d6989db70bc1ca311ac2cd?context=explore shows that the compressed size is at over 700 MB. The nice listing shows that large fractions come from installed Debian packages.

The first large chunk of 201.42 comes from buildpack-deps, https://github.com/docker-library/buildpack-deps/blob/d0ecd4b7313e9bc6b00d9a4fe62ad5787bc197ae/debian/bookworm/Dockerfile . The second large chunk of 265.72 MB comes from otobo.web.dockerfile .

The first idea is to base the image on perl:5.40-slim-bookworm. This means that some packages will have to be added to otobo.web.dockerfile . Let's try this.

bschmalhofer commented 2 days ago

The first try, see https://github.com/RotherOSS/otobo/tree/issue-%233542-reduce_attempt_1, gave a reduction of about 500 MB.

$ docker images | grep 'otobo ' | grep 11.1 otobo local-11.1.x b65c08aed2d4 8 minutes ago 1.63GB rotheross/otobo devel-rel-11_1 2e27e451d206 3 hours ago 2.11GB

This is less reduction than expected. TODO:

The new packages in otobo.web.dockerfile were:

  • "build-essential"\
  • "pkg-config"\
  • "libpq-dev"\
  • "libxml2-dev"\
  • "libxslt-dev"\
  • "libexpat-dev"\
  • "default-libmysqlclient-dev"\
bschmalhofer commented 2 days ago

Here is the output of dpigs. No smoking gun here. That chromium eats a lot of discspace was already known.

otobo@bfc93c5fdfbb:~$ dpigs -H -n 30 236MiB chromium 112MiB libllvm15 67MiB gcc-12 62MiB mariadb-client 47MiB libicu-dev 36MiB vim-runtime 36MiB libicu72 36MiB g++-12 34MiB cpp-12 29MiB libperl5.36 26MiB libgtk-3-common 25MiB libgl1-mesa-dri 23MiB libz3-4 21MiB adwaita-icon-theme 19MiB libstdc++-12-dev 18MiB coreutils 18MiB perl-modules-5.36 17MiB chromium-common 16MiB libx265-199 15MiB binutils-common 15MiB mariadb-client-core 14MiB libgcc-12-dev 13MiB libc6 13MiB libssl-dev 12MiB libc6-dev 12MiB binutils-x86-64-linux-gnu 10MiB libgtk-3-0 9.5MiB systemd 8.2MiB libpython3.11-stdlib 8.0MiB libmagic-mgc

bschmalhofer commented 2 days ago

Test suite looks fine, only three PGP related additional test failures:

Test Summary Report

/opt/otobo/scripts/test/Compile.t (Wstat: 0 Tests: 1754 Failed: 0) TODO passed: 709, 838 /opt/otobo/scripts/test/PGP/EmailHandling.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 0 tests but ran 1. /opt/otobo/scripts/test/Selenium/Agent/Admin/AdminPGP.t (Wstat: 256 (exited 1) Tests: 11 Failed: 1) Failed test: 11 Non-zero exit status: 1 /opt/otobo/scripts/test/Selenium/Agent/Admin/AgentTicketEmailPGP.t (Wstat: 256 (exited 1) Tests: 4 Failed: 1) Failed test: 4 Non-zero exit status: 1 /opt/otobo/scripts/test/Selenium/Agent/AgentTicketActionCommon/AgentTicketOwner.t (Wstat: 512 (exited 2) Tests: 44 Failed: 2) Failed tests: 43-44 Non-zero exit status: 2 /opt/otobo/scripts/test/Selenium/Agent/AgentTicketZoom.t (Wstat: 256 (exited 1) Tests: 70 Failed: 1) Failed test: 70 Non-zero exit status: 1 /opt/otobo/scripts/test/Selenium/Output/Preferences/Customer/PGP.t (Wstat: 256 (exited 1) Tests: 11 Failed: 1) Failed test: 9 Non-zero exit status: 1 /opt/otobo/scripts/test/Selenium/TestingMethods.t (Wstat: 0 Tests: 36 Failed: 0) TODO passed: 21, 24, 28 Files=968, Tests=81127, 3661 wallclock secs (16.31 usr 2.25 sys + 713.65 cusr 104.99 csys = 837.20 CPU) Result: FAIL ran tests for product OTOBO 11.1.x on host 0ef11da3d7a8 .

bschmalhofer commented 1 day ago

The lightweight alternative to Chromium is to use node.js on the server. For examples how this can be done see:

bschmalhofer commented 1 day ago

This was discussed in a Team-Meeting. The conclusion was that the switch to the new base image should be attempted for rel-11_1. Whether Chromium will be replace will be discussed in the dedicated issue.

bschmalhofer commented 1 day ago

TODO: