fix: restore apk upgrade to patch OS package CVEs in base image#73
Conversation
The #71 refactor (build swoole from source) dropped the `apk upgrade` calls that #70 had added to both the compile and final stages. As a result `appwrite/base:1.4.2` shipped unpatched OS packages, surfacing 315 Trivy alerts in downstream images (musl, openssl, zlib, libpng, libexpat, util-linux, imagemagick, rsync, py3-cryptography, ...). Restore `apk upgrade --no-cache` in both stages so the runtime image picks up the latest patched packages from the pinned Alpine repo at build time. Verified against the pinned php:8.5-alpine digest that all flagged packages now resolve to fixed versions (musl 1.2.5-r23, openssl 3.5.6-r0, imagemagick 7.1.2.24-r0, rsync 3.4.3-r0, libpng 1.6.58-r1, py3-cryptography 46.0.7-r0, util-linux 2.41.4-r0). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Greptile SummaryRestores two
Confidence Score: 5/5This is a safe, two-line restoration of intentional behaviour that directly addresses open CVEs in downstream images. The change is a minimal, targeted restoration of two No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix: restore apk upgrade to patch OS pac..." | Re-trigger Greptile |
appwrite/base:1.4.3 restores the `apk upgrade` step (appwrite/docker-base#73) that the #71 refactor had dropped, rebuilding the runtime image with patched Alpine packages. This clears the 315 Trivy OsPackageVulnerability alerts in the appwrite image (musl, openssl, zlib, libpng, libexpat, util-linux, imagemagick, rsync, py3-cryptography, ...). Verified appwrite/base:1.4.3 ships the fixed versions: musl 1.2.5-r23, openssl/libssl3/libcrypto3 3.5.6-r0, zlib 1.3.2-r0, libpng 1.6.58-r1, libexpat 2.7.5-r0, imagemagick 7.1.2.24-r0, rsync 3.4.3-r0, py3-cryptography 46.0.7-r0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
The current
appwrite/base:1.4.2image ships unpatched OS packages, which surface as 315 open Trivy code-scanning alerts in downstream images (e.g.appwrite/appwriteon1.9.x). Affected packages includemusl,openssl/libssl3/libcrypto3,zlib,libpng,libexpat,util-linux(libblkid/libmount),imagemagick*,rsync, andpy3-cryptography.Root cause
#70 added
apk upgradeto both the compile and final stages specifically "to patch musl and xz CVEs … the published image was shipping unpatched libs from the base."#71 (build swoole from source) then refactored the Dockerfile and accidentally dropped both
apk upgradecalls. Since then the runtime image only runsapk add, so inherited base packages are never upgraded and the published image freezes whatever was baked into the base at build time.Fix
Restore
apk upgrade --no-cachein thecompileandfinalstages (one line each). On rebuild, the runtime image pulls the latest patched packages from the pinned Alpine repo.Verification
Ran the exact final-stage apk sequence against the pinned
php:8.5-alpine@sha256:3cfccf28…digest. Every flagged package now resolves to a version that meets or exceeds the alert's fixed version:docker build --checkpasses with no warnings.Follow-up
After this merges and a new
appwrite/baserelease is cut, bumpFROM appwrite/base:1.4.2inappwrite/appwrite(1.9.x) to the new tag to clear the 315 downstream alerts.🤖 Generated with Claude Code