-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Dockerfile: optimize layers #10103
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
Open
marcofranssen
wants to merge
1
commit into
fluent:master
Choose a base branch
from
marcofranssen:optimize-dockerfile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dockerfile: optimize layers #10103
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,15 @@ FROM debian:bookworm-slim AS builder-base | |
COPY --from=qemu-arm32 /usr/bin/qemu-arm-static /usr/bin/ | ||
COPY --from=qemu-arm64 /usr/bin/qemu-aarch64-static /usr/bin/ | ||
|
||
ARG FLB_NIGHTLY_BUILD | ||
ENV FLB_NIGHTLY_BUILD=$FLB_NIGHTLY_BUILD | ||
ARG FLB_NIGHTLY_BUILD \ | ||
FLB_CHUNK_TRACE=On | ||
|
||
ARG FLB_CHUNK_TRACE=On | ||
ENV FLB_CHUNK_TRACE=${FLB_CHUNK_TRACE} | ||
ENV FLB_NIGHTLY_BUILD=$FLB_NIGHTLY_BUILD \ | ||
FLB_CHUNK_TRACE=${FLB_CHUNK_TRACE} \ | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# hadolint ignore=DL3008 | ||
RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/sources.list && \ | ||
apt-get update && \ | ||
|
@@ -68,8 +67,9 @@ FROM builder-base AS builder | |
WORKDIR /src/fluent-bit/build/ | ||
|
||
# Required to be set to ARMV7 for that target | ||
ARG WAMR_BUILD_TARGET | ||
ARG EXTRA_CMAKE_FLAGS | ||
ARG WAMR_BUILD_TARGET \ | ||
EXTRA_CMAKE_FLAGS | ||
|
||
ENV EXTRA_CMAKE_FLAGS=${EXTRA_CMAKE_FLAGS} | ||
|
||
# We do not want word splitting for EXTRA_CMAKE_FLAGS in case multiple are defined | ||
|
@@ -94,8 +94,8 @@ RUN [ -n "${WAMR_BUILD_TARGET:-}" ] && EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DW | |
ARG CFLAGS="-v" | ||
ENV CFLAGS=${CFLAGS} | ||
|
||
RUN make -j "$(getconf _NPROCESSORS_ONLN)" | ||
RUN install bin/fluent-bit /fluent-bit/bin/ | ||
RUN make -j "$(getconf _NPROCESSORS_ONLN)" && \ | ||
install bin/fluent-bit /fluent-bit/bin/ | ||
|
||
# Configuration files | ||
COPY conf/fluent-bit.conf \ | ||
|
@@ -177,6 +177,7 @@ RUN find /dpkg/ -type d -empty -delete && \ | |
# We want latest at time of build | ||
# hadolint ignore=DL3006 | ||
FROM gcr.io/distroless/cc-debian12 AS production | ||
EXPOSE 2020 | ||
ARG RELEASE_VERSION | ||
ENV FLUENT_BIT_VERSION=${RELEASE_VERSION} | ||
LABEL description="Fluent Bit multi-architecture container image" \ | ||
|
@@ -192,17 +193,15 @@ LABEL description="Fluent Bit multi-architecture container image" \ | |
org.opencontainers.image.documentation="https://docs.fluentbit.io/" \ | ||
org.opencontainers.image.authors="Eduardo Silva <[email protected]>" | ||
|
||
# Copy the libraries from the extractor stage into root | ||
COPY --from=deb-extractor /dpkg / | ||
|
||
# Copy certificates | ||
COPY --from=builder /etc/ssl/certs /etc/ssl/certs | ||
|
||
# Copy the libraries from the extractor stage into root | ||
COPY --from=deb-extractor /dpkg / | ||
|
||
# Finally the binaries as most likely to change | ||
COPY --from=builder /fluent-bit /fluent-bit | ||
|
||
EXPOSE 2020 | ||
|
||
# Entry point | ||
ENTRYPOINT [ "/fluent-bit/bin/fluent-bit" ] | ||
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf"] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved up, as this is not likely to change, meaning the layer doesn't have to be rebuild,pushed,pulled.