Skip to content

Adds docker support#12

Open
rknightion wants to merge 9 commits intowobcom:mainfrom
rknightion:main
Open

Adds docker support#12
rknightion wants to merge 9 commits intowobcom:mainfrom
rknightion:main

Conversation

@rknightion
Copy link
Copy Markdown

Adds docker support to the project allowing users to run the exporter via docker/compose. Includes relevant compose.yml.

…uild

Changes the version constant to a variable to allow build-time version
injection via ldflags during Docker image builds. This enables proper
version tracking in containerized deployments where the version is
passed as a build argument.
Provides container infrastructure for the transceiver-exporter:

- **Dockerfile**: Multi-stage build using Alpine for compilation and
  distroless base for minimal production image (~2MB), supports
  multi-architecture builds (amd64/arm64) with version injection
- **compose.yml**: Docker Compose configuration with host networking
  (required for interface enumeration), CAP_NET_ADMIN capability
  (required for ethtool operations), security hardening, and resource
  limits

Enables easier deployment and distribution of the exporter in
containerized environments.
…ublishing

Implements automated Docker image build and publish pipeline:

- Builds AMD64 and ARM64 images natively on respective runners to
  avoid QEMU emulation overhead
- Creates multi-architecture manifest combining both images
- Publishes to GitHub Container Registry on release, main branch
  push, and manual trigger
- Includes semantic versioning tags, latest tag, and SHA digests
- Uses GitHub Actions cache for faster builds and artifact upload
  for digest coordination between jobs

Enables seamless distribution of pre-built container images to users
and improves CI/CD automation.
- Add pull request event trigger to build workflow for validation
- Replace generic 'latest' tag with event-specific logic: only apply latest tag on release events
- Add 'dev' tag for pushes to main branch to differentiate development builds
- Add pull request reference tag for PR validation builds
- Ensures clearer image versioning and prevents accidental overwrites of stable releases
- Restructure prerequisites section at top with clearer explanation of host network mode requirement
- Add detailed comments for each command-line option with descriptions and defaults
- Organize options into logical sections: Web Server, Collector, and Interface Filtering
- Add warnings about performance impact of interface-features collector on many-port switches
- Expand documentation for optical power conversion and IEEE754 floating point considerations
- Simplify container configuration by removing unused deploy/resource limits and logging sections
- Update default image repository from GITHUB_REPOSITORY variable to wobcom/transceiver-exporter
- Make all advanced options commented out by default with clear enable/disable guidance
Expand multi-architecture Docker image builds to support additional platforms:

- Add build-386 job to build and push 32-bit x86 Docker images using QEMU emulation
- Add build-arm job to build and push ARM/v7 Docker images using QEMU emulation
- Both jobs follow the same pattern as existing amd64 and arm64 builds with consistent metadata tagging
- Update create-manifest job to depend on the new 386 and ARM builds
- Enables broader hardware support and improves accessibility for legacy systems and embedded devices
@rknightion rknightion marked this pull request as draft January 29, 2026 12:00
@rknightion
Copy link
Copy Markdown
Author

marking as draft while working on some permissions issues with the -m functionality

Switch from distroless nonroot image to standard distroless image to enable root execution, which is required for the ethtool module to access transceiver EEPROM data.

- Replace gcr.io/distroless/static-debian13:nonroot with gcr.io/distroless/static-debian13
- Remove USER nonroot:nonroot directive
- Update image documentation to reflect root execution requirement
- Maintain all other security features (CA certs, tzdata, minimal attack surface)
@rknightion rknightion marked this pull request as ready for review January 29, 2026 12:13
@rknightion
Copy link
Copy Markdown
Author

Fixed permissions issues (can't read eeprom without running as root inside the container)

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.

1 participant