fix: pin collector docker image root path across versions#4189
Open
orangeCatDeveloper wants to merge 2 commits into
Open
fix: pin collector docker image root path across versions#4189orangeCatDeveloper wants to merge 2 commits into
orangeCatDeveloper wants to merge 2 commits into
Conversation
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
051afbe to
e2cd83d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-vmount paths forlogs/ext-libbreak 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 VERSIONthat 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 pathbuild.sh: drop the now-unused--build-arg VERSIONext-libmountTested
/opt/hertzbeat-collectorFixes #2175