Skip to content

fix: pin collector docker image root path across versions#4189

Open
orangeCatDeveloper wants to merge 2 commits into
apache:masterfrom
orangeCatDeveloper:fix/issue-2175-collector-root-path
Open

fix: pin collector docker image root path across versions#4189
orangeCatDeveloper wants to merge 2 commits into
apache:masterfrom
orangeCatDeveloper:fix/issue-2175-collector-root-path

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

The collector Docker image's internal path used to include the version number, e.g. /opt/apache-hertzbeat-collector-1.6.0-bin. That means every time you upgrade, your -v mount paths for logs/ext-lib break and need to be updated manually.

This PR makes the path fixed: always /opt/hertzbeat-collector, no matter the version. It also fixes a related bug: the Dockerfile relied on a --build-arg VERSION that CI never actually passed, so the image build was silently broken.

Changes

  • Dockerfile: extract the tarball and rename it to a fixed folder name instead of using the version in the path
  • build.sh: drop the now-unused --build-arg VERSION
  • docs: mention the new stable path and the ext-lib mount

Tested

  • Built the image for real, ran it, confirmed the path is /opt/hertzbeat-collector
  • Also tested with both the normal package and the native package sitting in the build folder together (real release scenario) — build succeeds; the old code breaks in this exact case

Fixes #2175

@github-actions github-actions Bot added doc Improvements or additions to documentation docker script labels Jul 9, 2026
The collector Docker image baked the version number into its
container path (/opt/apache-hertzbeat-collector-${VERSION}-bin),
requiring users to update their logs/ext-lib volume mounts on every
upgrade. It also relied on a --build-arg VERSION that the nightly CI
workflow never passed, breaking the ADD/WORKDIR path resolution.

Extract the tarball via a version-agnostic glob and rename it to a
fixed /opt/hertzbeat-collector root, matching the version-independent
layout the server image already uses. The glob is restricted to
apache-hertzbeat-collector-[0-9]*-bin.tar.gz so it doesn't also match
the native collector package that ships alongside it in dist/, which
would otherwise make the extraction step ambiguous.

Fixes apache#2175
@orangeCatDeveloper orangeCatDeveloper force-pushed the fix/issue-2175-collector-root-path branch from 051afbe to e2cd83d Compare July 9, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation docker script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] about the docker mount path in v1.6.0 docker

2 participants