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

chore: upgrade libc and zlib in the Dockerfile #392

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Changes from all commits
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
26 changes: 26 additions & 0 deletions sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,35 @@ ADD ./out_gstdout /build/
WORKDIR /build
RUN make all

# Manually upgrade libc and zlib to address https://www.cve.org/CVERecord?id=CVE-2022-37434 and https://www.cve.org/CVERecord?id=CVE-2021-3999
# TODO: Revert this after fluent-bit 1.9.9 is released
FROM debian:bullseye-slim as deb-extractor

# We download all debs locally then extract them into a directory we can use as the root for distroless.
# This is directly copied from Fluent Bit's upstream Dockerfile
WORKDIR /tmp
RUN apt-get update && \
apt-get download \
zlib1g \
libc6 && \
mkdir -p /dpkg/var/lib/dpkg/status.d/ && \
for deb in *.deb; do \
package_name=$(dpkg-deb -I ${deb} | awk '/^ Package: .*$/ {print $2}'); \
echo "Processing: ${package_name}"; \
dpkg --ctrl-tarfile $deb | tar -Oxf - ./control > /dpkg/var/lib/dpkg/status.d/${package_name}; \
dpkg --extract $deb /dpkg || exit 10; \
done

# Remove unnecessary files extracted from deb packages like man pages and docs etc.
RUN find /dpkg/ -type d -empty -delete && \
rm -r /dpkg/usr/share/doc/

FROM fluent/fluent-bit:1.9.7
ENV LOG_LEVEL=warning

# Copy the libraries from the extractor stage into root
COPY --from=deb-extractor /dpkg /

COPY --from=go-builder \
/build/out_gstdout.so \
/tailing-sidecar/lib/
Expand Down