// Module included in the following assemblies:
//
// * hardware_enablement/kmm-kernel-module-management.adoc

:_mod-docs-content-type: PROCEDURE
[id="kmm-building-a-kmod-image_{context}"]
= Building a kmod image

[role="_abstract"]
To build a kmod image with firmware support in {product-title}, you can include the binary firmware in the builder image alongside the kernel module.

.Procedure

* In addition to building the kernel module itself, include the binary firmware in the builder image:
+
[source,dockerfile]
----
FROM registry.redhat.io/ubi9/ubi-minimal as builder

# Build the kmod

RUN ["mkdir", "/firmware"]
RUN ["curl", "-o", "/firmware/firmware.bin", "https://artifacts.example.com/firmware.bin"]

FROM registry.redhat.io/ubi9/ubi-minimal

# Copy the kmod, install modprobe, run depmod

COPY --from=builder /firmware /firmware
----
