Skip to content

Commit cb7683d

Browse files
authored
Merge pull request #79 from hershpa/optimize-driver-image
docker: Optimize driver container image size
2 parents 884b2f5 + 2c3df27 commit cb7683d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docker/intel-dgpu-driver.Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ RUN git clone -b ${I915_RELEASE} --single-branch https://github.com/intel-gpu/in
3434
&& cp defconfigs/i915 .config \
3535
&& make olddefconfig && make modules -j $(nproc) && make modules_install
3636

37+
# Copy out-of-tree drivers to /opt/lib/modules/${KERNEL_FULL_VERSION}/
38+
RUN for file in $(find /lib/modules/${KERNEL_FULL_VERSION}/updates/ -name "*.ko"); do \
39+
cp $file /opt --parents; done
40+
41+
# Create the symbolic link for in-tree dependencies
42+
RUN ln -s /lib/modules/${KERNEL_FULL_VERSION} /opt/lib/modules/${KERNEL_FULL_VERSION}/host
43+
44+
RUN depmod -b /opt ${KERNEL_FULL_VERSION}
45+
3746
# Firmware
3847
RUN git clone -b ${FIRMWARE_RELEASE} --single-branch https://github.com/intel-gpu/intel-gpu-firmware.git \
3948
&& install -D /build/intel-gpu-firmware/COPYRIGHT /licenses/firmware/COPYRIGHT \
@@ -61,7 +70,5 @@ and Firmware release:${FIRMWARE_RELEASE}. This driver container image is support
6170
RUN microdnf update -y && rm -rf /var/cache/yum
6271
RUN microdnf -y install kmod findutils && microdnf clean all
6372
COPY --from=builder /licenses/ /licenses/
64-
COPY --from=builder /lib/modules/${KERNEL_FULL_VERSION}/ /opt/lib/modules/${KERNEL_FULL_VERSION}/
65-
COPY --from=builder /build/firmware/ /firmware/i915/
66-
67-
RUN depmod -b /opt ${KERNEL_FULL_VERSION}
73+
COPY --from=builder /opt/lib/modules/${KERNEL_FULL_VERSION}/ /opt/lib/modules/${KERNEL_FULL_VERSION}/
74+
COPY --from=builder /build/firmware/ /firmware/i915/

0 commit comments

Comments
 (0)