Skip to content
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
23 changes: 21 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ RUN apt-get update && \
&& \
apt-get clean

# TODO: temporary, remove with Bookworm (and in the runner): it ships libbrotli 1.0.9, cbrotli needs >= 1.1 and 1.2.1 fixes CVE-2026-111497
WORKDIR /usr/local/src/brotli
RUN <<'EOF'
set -e
if pkg-config --atleast-version=1.1 libbrotlienc; then
exit 0
fi
curl -fsSL -o brotli.tar.gz https://github.com/google/brotli/archive/refs/tags/v1.2.1.tar.gz
echo "98d35d11a78dc453aebb7d10c3748f3f73ff78c8267c0dc697b8631f67bf7e8f brotli.tar.gz" | sha256sum -c -
tar xzf brotli.tar.gz --strip-components 1
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF
cmake --build build
cmake --install build
# Multiarch dirs sort before libc.conf on arm64, arm and i386, so the distro libbrotli would win
echo /usr/local/lib > /etc/ld.so.conf.d/000-brotli.conf
ldconfig
EOF

# Install e-dant/watcher (necessary for file watching)
WORKDIR /usr/local/src/watcher
RUN --mount=type=secret,id=github-token <<'EOF'
Expand Down Expand Up @@ -137,11 +155,12 @@ FROM common AS runner

ENV GODEBUG=cgocheck=0

# copy watcher shared library
COPY --from=builder /usr/local/lib/libwatcher* /usr/local/lib/
# copy watcher and brotli (Bookworm only, temporary) shared libraries
COPY --from=builder /usr/local/lib/libwatcher* /usr/local/lib/libbrotli* /usr/local/lib/
# fix for the file watcher on arm
RUN apt-get install -y --no-install-recommends libstdc++6 && \
apt-get clean && \
if [ -e /usr/local/lib/libbrotlicommon.so.1 ]; then echo /usr/local/lib > /etc/ld.so.conf.d/000-brotli.conf; fi && \
ldconfig && \
# Remove files with non-deterministic content (embedded timestamps and mtimes) to keep image digests reproducible
rm -rf /var/log/apt /var/log/dpkg.log /var/log/alternatives.log /var/cache/ldconfig/aux-cache
Expand Down
Loading