Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfiles: reduce debug information from the production container image. #8821

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
ENV FLB_CHUNK_TRACE=${FLB_CHUNK_TRACE}

RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log
RUN mkdir -p /usr/lib/debug/fluent-bit/bin

Check warning on line 32 in dockerfiles/Dockerfile

View workflow job for this annotation

GitHub Actions / PR - Hadolint

[hadolint] reported by reviewdog 🐶 Multiple consecutive `RUN` instructions. Consider consolidation. Raw Output: message:"Multiple consecutive `RUN` instructions. Consider consolidation." location:{path:"dockerfiles/Dockerfile" range:{start:{line:32 column:1}}} severity:INFO source:{name:"hadolint" url:"https://github.com/hadolint/hadolint"} code:{value:"DL3059" url:"https://github.com/hadolint/hadolint/wiki/DL3059"}
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for a separate layer, just add it above

Copy link
Author

Choose a reason for hiding this comment

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

61ef5d4
I made corrections and added new commits.
Also, I consolidated the objcopy processing into a single layer.


ENV DEBIAN_FRONTEND noninteractive

Expand Down Expand Up @@ -81,6 +82,10 @@
RUN make -j "$(getconf _NPROCESSORS_ONLN)"
RUN install bin/fluent-bit /fluent-bit/bin/

RUN objcopy --only-keep-debug /fluent-bit/bin/fluent-bit /usr/lib/debug/fluent-bit/bin/fluent-bit.debug

Check warning on line 85 in dockerfiles/Dockerfile

View workflow job for this annotation

GitHub Actions / PR - Hadolint

[hadolint] reported by reviewdog 🐶 Multiple consecutive `RUN` instructions. Consider consolidation. Raw Output: message:"Multiple consecutive `RUN` instructions. Consider consolidation." location:{path:"dockerfiles/Dockerfile" range:{start:{line:85 column:1}}} severity:INFO source:{name:"hadolint" url:"https://github.com/hadolint/hadolint"} code:{value:"DL3059" url:"https://github.com/hadolint/hadolint/wiki/DL3059"}
RUN objcopy --strip-debug /fluent-bit/bin/fluent-bit

Check warning on line 86 in dockerfiles/Dockerfile

View workflow job for this annotation

GitHub Actions / PR - Hadolint

[hadolint] reported by reviewdog 🐶 Multiple consecutive `RUN` instructions. Consider consolidation. Raw Output: message:"Multiple consecutive `RUN` instructions. Consider consolidation." location:{path:"dockerfiles/Dockerfile" range:{start:{line:86 column:1}}} severity:INFO source:{name:"hadolint" url:"https://github.com/hadolint/hadolint"} code:{value:"DL3059" url:"https://github.com/hadolint/hadolint/wiki/DL3059"}
RUN objcopy --add-gnu-debuglink=/usr/lib/debug/fluent-bit/bin/fluent-bit.debug /fluent-bit/bin/fluent-bit

Check warning on line 87 in dockerfiles/Dockerfile

View workflow job for this annotation

GitHub Actions / PR - Hadolint

[hadolint] reported by reviewdog 🐶 Multiple consecutive `RUN` instructions. Consider consolidation. Raw Output: message:"Multiple consecutive `RUN` instructions. Consider consolidation." location:{path:"dockerfiles/Dockerfile" range:{start:{line:87 column:1}}} severity:INFO source:{name:"hadolint" url:"https://github.com/hadolint/hadolint"} code:{value:"DL3059" url:"https://github.com/hadolint/hadolint/wiki/DL3059"}

# Configuration files
COPY conf/fluent-bit.conf \
conf/parsers.conf \
Expand Down Expand Up @@ -231,6 +236,7 @@

RUN rm -f /usr/bin/qemu-*-static
COPY --from=builder /fluent-bit /fluent-bit
COPY --from=builder /usr/lib/debug/fluent-bit /usr/lib/debug/fluent-bit

EXPOSE 2020

Expand Down
Loading