-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Hardened Docker base images fail due to usrmerge incompatibility on Debian 12 #60123
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
base: main
Are you sure you want to change the base?
Conversation
|
I guess you could replace lsb-release - > from what I remember, it's only used to easier retrieve the release version and can be likely replaced with direct reading of the release version |
I did try replacing lsb-release entirely. |
|
I looked it up - and I would be very surprised to see usrmerge not working- https://wiki.debian.org/UsrMerge seems to be required by Debian starting from bookworm and there is a long discussion about adopting it, so I guess hardened image based on debian has to support it this way or the other. |
|
That matches what I observed. Since usrmerge is required starting with Debian 12, a Debian-based hardened image that blocks its postinst lifecycle is effectively incompatible. From Airflow’s side, this doesn’t seem solvable without either avoiding hardened Debian images or relying on upstream fixes in the base image. |
ddbd153 to
917d794
Compare
7984e95 to
9541328
Compare
|
@suii2210 hey, did you manage to overcome the latest issue? |
|
hello @shahar1 |
While experimenting with switching Airflow CI images to Docker Hardened Images (dhi.io/python:*), CI builds consistently fail during OS dependency installation on Debian 12.
The failure is caused by
usrmergebeing implicitly installed as a dependency (via lsb-release) and breaking during its post-installation step due to filesystem restrictions in hardened images.This issue is deterministic and cannot be resolved through script-level workarounds.
Environment
Observed Failure
During apt-get install,
usrmergeis pulled in automatically:This leaves dpkg in a half-configured state and causes the Docker build to fail permanently.
Root Cause Analysis
usrmergeis installed indirectly, primarily via lsb-releaseusrmerge.postinstimmediately during unpackusrmergeattempts to:Once
usrmergereaches the unpack phase, no cleanup, purge, or hold can recover the build.What Was Tried (and Why It Does Not Work)
The following approaches were tested and confirmed ineffective:
All of these fail because
usrmergeexecutes its post-install script before any script-level logic can intervene.Validation
Switching back to a non-hardened base image confirms the diagnosis:
FROM python:3.12-slim-bookwormusrmergeinstallationdpkgcorruptionThis proves the failure is caused by base-image incompatibility, not Airflow scripts.
Conclusion
This is not a bug in Airflow’s Docker scripts.
It is an incompatibility between:
Debian 12’s
usrmergelifecycleand Docker Hardened Images’ filesystem restrictions
As long as
usrmergeis allowed to unpack, CI builds on hardened images will fail.