How to fix CVEs in Ubuntu container images
Short answer
Ubuntu images are fixed by apt-get upgrade from the security pocket of a supported LTS release. Some fixes for packages in universe are published only to Ubuntu Pro (ESM) subscribers; without it those CVEs stay. Use a supported LTS and remove packages the application does not use.
Fix a Ubuntu image now →
free, no sign-up; pre-filled with ubuntu:24.04, change it to yours
The steps
- 01apt-get upgradeFixes from the security pocket of your release.
- 02Supported LTSInterim releases are supported for nine months only.
- 03Know what needs ProSome universe fixes are published to ESM only.
- 04Remove what is not usedFewer packages, fewer CVEs to wait for.
By hand
FROM ubuntu:24.04 RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
Then rescan: the CVEs that remain are either without a released fix or in code the application never loads (the report marks both).
Traps that bring CVEs back
- Interim releases reach end of life quickly: base production images on an LTS.
- Fixes published only to ESM are reported as available with Ubuntu Pro, not as fixed.
Ubuntu images in OCImend's reports
| Image | Grade | Known CVEs | |
|---|---|---|---|
| ubuntu:noble-20261110.1 | A | 6 | Fix |
| ubuntu:26.10 | A | 0 | Fix |
Questions
How do I fix CVEs in a Ubuntu container image?
Ubuntu images are fixed by apt-get upgrade from the security pocket of a supported LTS release. Some fixes for packages in universe are published only to Ubuntu Pro (ESM) subscribers; without it those CVEs stay. Use a supported LTS and remove packages the application does not use.
Do I need Ubuntu Pro to patch my image?
Not for main; some universe fixes are published to Pro only.
Which Ubuntu base for containers?
The current LTS, with only the packages the app needs.
Other image types
Python · Node.js · Java · Go · nginx · PostgreSQL · Alpine · Debian · Red Hat UBI