[receiver/journaldreceiver] Optimize example Dockerfile#45859
Conversation
- 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
95388b2 to
c0cbb0c
Compare
|
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. |
|
Asking for codeowners to chime in. |
|
@atoulme I agree that optimization may not be necessary here, and I'm open to deleting or moving this example if that makes more sense. (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.) |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description
This PR improves the example Dockerfile for the
journaldreceiverto 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:
debian:trixie-slim. This updates the environment to the next stable generation, providing more up-to-date system libraries.RUNcommands into a single layer to reduce metadata overhead and image size.-no-install-recommendsto prevent the installation of unnecessary packages.wget) within the same layer.ca-certificatesto ensure secure HTTPS downloads and verified certificate chains.EXPOSEinstructions for standard OTLP and monitoring ports (4317, 4318, 8888) for better container orchestration visibility.README.mdto reflect the improved Dockerfile structure and usage instructions.Link to tracking issue
Supersedes #43126
Testing
RUNcommand executes without errors.debian:trixie-slimbase.README.mdcorrectly describes the build and run process.Documentation
receiver/journaldreceiver/README.mdwith the new Dockerfile specifications and port information.