procps is installed with the build dependencies and purged again, so `ps` is missing

Open Beginner friendly
#422 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, dockerfile, shell
Domain
devops

Research direction

The fpm Dockerfile's RUN block installs procps alongside build-only libraries, then runs apt-mark auto '.*' and apt-get purge --auto-remove. Read that block and the savedAptMark logic, then keep procps outside the purge, either by marking it manual or installing it after the cleanup. Done when command -v ps succeeds in the built matomo:5-fpm and matomo:6-fpm images.

Written by the indexing model from the issue text.

Description

The fpm (and apache) Dockerfile installs procps in the same apt-get install as the build-only packages (libfreetype-dev, libzip-dev, …):

savedAptMark="$(apt-mark showmanual)"; \
apt-get install -y --no-install-recommends \
    libfreetype-dev libjpeg-dev libldap2-dev libpng-dev libzip-dev \
    procps \
; \

The clean-up at the end of the same RUN marks everything as automatic (apt-mark auto '.*'), re-marks only the libraries the PHP extensions link against, and runs apt-get purge --auto-remove. procps isn't one of those libraries, so it is removed again:

$ docker run --rm --entrypoint sh matomo:5-fpm -c 'command -v ps || dpkg -s procps'
dpkg-query: package 'procps' is not installed and no information is available

Same on matomo:6-fpm.

Without ps, Matomo can't run archiving in parallel CLI processes (CliMulti needs it to watch them; the system check shows "Prozesse via CLI steuern: nicht unterstützt" / "Process control via CLI: not supported") and falls back to HTTP requests to its own URL. #257 tried to add procps for exactly this in 2021 and was closed unmerged; the package is in the list today, but it doesn't survive the purge.

Fix: install procps as a runtime package, outside savedAptMark - e.g. apt-mark manual procps before the purge, or a separate apt-get install after it. Happy to send a PR if that's welcome.

Dominant language
Shell
Stars
1k
Forks
389
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from matomo-org/docker

All issues in matomo-org/docker

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.