[PR #5172] feat(build): Add multi-stage Dockerfile for management server #25164

Open
opened 2026-08-05 06:09:37 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5172

State: closed
Merged: No


Summary

  • Adds Dockerfile.multistage for building management server with correct binary format
  • Solves ar archive issue (binary was library instead of executable)

Problem

Building with go build ./management/cmd/ produced an ar archive because cmd/ has package cmd, not package main.

Solution

  • Use ./management/ which has main.go with package main
  • Multi-stage build inside golang:1.25 container
  • No cross-compilation issues

Usage

docker build -f management/Dockerfile.multistage -t netbird-fork/management:latest .

Test plan

  • Binary is ELF executable (verified with file command)
  • Container starts successfully
  • mTLS server runs on port 33074
  • Deployed and tested on lab (10.0.0.103)

Relates to: #93

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added mTLS certificate-based authentication for machine peers with dedicated registration and management endpoints.
    • Introduced automated dependency updates via Dependabot configuration.
    • Added GitHub issue templates for structured bug reports, features, epics, stories, and tasks.
  • CI/CD Improvements

    • Implemented automatic issue and pull request labeling based on title analysis.
    • Added pull request linting to enforce consistent commit message conventions.
    • Configured pre-commit hooks for code quality checks.
  • Build & Infrastructure

    • Enhanced build system with multi-platform cross-compilation support.
    • Added containerized management service deployment.
    • Introduced lab automation scripts for testing environments.

✏️ Tip: You can customize this high-level summary in your review settings.

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5172 **State:** closed **Merged:** No --- ## Summary - Adds `Dockerfile.multistage` for building management server with correct binary format - Solves ar archive issue (binary was library instead of executable) ## Problem Building with `go build ./management/cmd/` produced an ar archive because `cmd/` has `package cmd`, not `package main`. ## Solution - Use `./management/` which has `main.go` with `package main` - Multi-stage build inside golang:1.25 container - No cross-compilation issues ## Usage ```bash docker build -f management/Dockerfile.multistage -t netbird-fork/management:latest . ``` ## Test plan - [x] Binary is ELF executable (verified with `file` command) - [x] Container starts successfully - [x] mTLS server runs on port 33074 - [x] Deployed and tested on lab (10.0.0.103) Relates to: #93 🤖 Generated with [Claude Code](https://claude.ai/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added mTLS certificate-based authentication for machine peers with dedicated registration and management endpoints. * Introduced automated dependency updates via Dependabot configuration. * Added GitHub issue templates for structured bug reports, features, epics, stories, and tasks. * **CI/CD Improvements** * Implemented automatic issue and pull request labeling based on title analysis. * Added pull request linting to enforce consistent commit message conventions. * Configured pre-commit hooks for code quality checks. * **Build & Infrastructure** * Enhanced build system with multi-platform cross-compilation support. * Added containerized management service deployment. * Introduced lab automation scripts for testing environments. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 06:09:37 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#25164