Skip to content

[receiver/journaldreceiver] Optimize example Dockerfile#45859

Closed
vidam-io wants to merge 2 commits into
open-telemetry:mainfrom
vidam-io:fix/journaldreceiver-dockerfile
Closed

[receiver/journaldreceiver] Optimize example Dockerfile#45859
vidam-io wants to merge 2 commits into
open-telemetry:mainfrom
vidam-io:fix/journaldreceiver-dockerfile

Conversation

@vidam-io
Copy link
Copy Markdown
Contributor

@vidam-io vidam-io commented Feb 4, 2026

Description

This PR improves the example Dockerfile for the journaldreceiver to align with Docker best practices and ensures a more efficient, secure, and modern build environment.

Assisted-by: Claude Opus 4.5

Changes included in this PR:

  • Base Image Update: Switched to debian:trixie-slim. This updates the environment to the next stable generation, providing more up-to-date system libraries.
  • Image Size Optimization: * Consolidated multiple RUN commands into a single layer to reduce metadata overhead and image size.
  • Added -no-install-recommends to prevent the installation of unnecessary packages.
  • Implemented cleanup logic to remove the downloaded tarball and build-only tools (wget) within the same layer.
  • Security & Reliability: Added ca-certificates to ensure secure HTTPS downloads and verified certificate chains.
  • Interoperability: Added EXPOSE instructions for standard OTLP and monitoring ports (4317, 4318, 8888) for better container orchestration visibility.
  • Documentation: Updated the README.md to reflect the improved Dockerfile structure and usage instructions.

Link to tracking issue

Supersedes #43126

Testing

  • Conducted local builds to verify that the consolidated RUN command executes without errors.
  • Confirmed that the resulting image size is reduced compared to the previous multi-layer version.
  • Verified that the OpenTelemetry Collector binary runs successfully on the debian:trixie-slim base.
  • Checked that the updated documentation in README.md correctly describes the build and run process.

Documentation

  • Updated receiver/journaldreceiver/README.md with the new Dockerfile specifications and port information.

- Use debian:bookworm-slim (stable) instead of debian:13-slim
- Add ca-certificates for HTTPS downloads
- Add --no-install-recommends to reduce image size
- Consolidate RUN commands into single layer
- Remove tarball after extraction
- Auto-remove wget after use
- Add EXPOSE for OTLP ports (4317, 4318, 8888)

Assisted-by: Claude Opus 4.5
@vidam-io vidam-io force-pushed the fix/journaldreceiver-dockerfile branch from 95388b2 to c0cbb0c Compare February 4, 2026 09:46
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Feb 4, 2026

I don't know that this needs to be optimized, I'd advocate to delete this example instead... or move it to opentelemetry-collector-releases. The optimizations are tricks consisting in moving all the download to one layer, which is a bit besides the point since we don't build the docker image on the same machine often.

@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Feb 4, 2026

Asking for codeowners to chime in.

@vidam-io
Copy link
Copy Markdown
Contributor Author

vidam-io commented Feb 5, 2026

@atoulme
Thank you for the review and feedback!

I agree that optimization may not be necessary here, and I'm open to deleting or moving this example if that makes more sense.
I'm not very familiar with the releases repository, but if moving this example would better satisfy the requirements discussed in open-telemetry/opentelemetry-collector-releases#462 , I'd be supportive of that direction.

(For context: I originally looked into this because I reviewed #43731, but due to company policy restrictions that prevent mounting multiple paths, I was exploring the image bundling approach instead.)

@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Feb 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants