Skip to content

Conversation

@molBR
Copy link
Contributor

@molBR molBR commented Oct 20, 2025

Summary

This PR modernizes the Netdata installation process by switching from source compilation to using pre-built static binaries.

Changes

  • Dockerfile improvements:

    • Replace git clone + compile approach with official pre-built static binaries from GitHub releases
    • Add NETDATA_VERSION build argument for easier version management
    • Improve structure with clear sections and better formatting
    • Create logging directory before symlinking to stdout/stderr
    • Reduce image size by removing unnecessary build dependencies
  • Build script updates:

    • Update scripts/build.sh to use Docker Buildx for multi-architecture support
    • Add safety checks to prevent accidental local execution
    • Improve output formatting and error handling

Benefits

  • Faster builds: ~2 minutes instead of ~10-15 minutes (no compilation needed)
  • More reliable: Direct downloads from GitHub releases instead of git clone + compile
  • Smaller images: Minimal dependencies without build tools
  • Better maintainability: Version controlled via build argument
  • Multi-arch support: Ready for amd64, arm64, armv7, and 386

- Replace git clone + compile approach with pre-built static binaries
- Add NETDATA_VERSION build argument for easier version management
- Improve Dockerfile structure with clear sections and better formatting
- Update build.sh to use Docker Buildx for multi-architecture support
- Add logging directory creation before symlinking to stdout/stderr
- Clean up unnecessary build dependencies and reduce image size

This change improves build reliability and speed by using official
static binaries instead of compiling from source during image build.
Copy link
Contributor

@githubsaturn githubsaturn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the attempt to fix. But there are multiple issues with this PR. Also, I am not sure why a version bump of Netdata requires some surgical changes in the build and push script. The rootcause must be something else.

rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt full-upgrade -y && chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.sh reference is removed from Dockerfile. So it's not called anymore?!

echo "=========================================="

# Setup QEMU for multi-arch builds
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated in build_and_push.sh...

@githubsaturn
Copy link
Contributor

Okay, so I reverted the PR and the build still fails. Somewhat of a good sign... It's not the version upgrade that broke the build, but it's the fact that it's too old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants