Updating container dependencies
This is the most common container image operation – more frequent than creating new images.
Adding an RPM dependency
-
Add the package name to
builds/<name>/rpms/rpms.in.yamlunderpackages:. -
If the package is only needed at build time (e.g.,
gcc,python3-devel), tag it with# builddep. -
Regenerate the RPM lockfile:
make builds/<name>/rpms/rpms.lock.yaml -
If the new RPM provides a Python package that’s also in the Python lockfile, add
--no-emit-package=<python-name>to the per-imagerequirements.lockheader and regenerate it. Add#include "verify-python-lockfiles"to the Containerfile if not already present.
Adding a Python dependency
-
Add the dependency to
pyproject.toml(under the appropriate extras group). -
Regenerate the root lockfile first:
make requirements.lock -
Then regenerate the per-image lockfile:
make builds/<name>/requirements.lock -
Order matters: the root lockfile is the constraint source for per-image lockfiles.
Updating existing dependencies
- Routine updates are handled automatically by Renovate. No manual action needed.
- Force an immediate update: regenerate the relevant lockfile(s) via
maketargets. - Pin a specific version: add a version constraint in
pyproject.tomlorrpms.in.yaml, then regenerate.
The # builddep marker
Packages tagged with # builddep in rpms.in.yaml are marked as build-only
dependencies. The cleanup include runs dnf autoremove which removes them
(along with their transitive deps) from the final image.
Use for: compilers (gcc), development headers (python3-devel, *-devel),
build tools (git-core when only needed for VCS pip installs).
Lockfile regeneration prerequisites
- Requires
dependency-tools:productionimage (pulled automatically by MakefilePODMAN_RUNmacro). - Uses a cache directory (default
/tmp/rpm-lockfile-cache) for DNF metadata; the Makefile creates it via an order-only prerequisite. - See Lockfiles for full details on the Makefile pattern and header format requirements.