mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-03 18:46:21 +00:00
We only convert kernels from Fedora 2* as they have 4.x kernels. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
29 lines
961 B
Docker
29 lines
961 B
Docker
FROM alpine:3.5 AS extract
|
|
|
|
ARG RPM_URLS
|
|
|
|
RUN apk add --no-cache curl rpm tar && true
|
|
WORKDIR /rpm
|
|
RUN mkdir extract
|
|
RUN for url in ${RPM_URLS}; do \
|
|
echo "Extracting: $url"; \
|
|
curl -fsSL -o dl.rpm $url && \
|
|
rpm2cpio dl.rpm | cpio -idm ;\
|
|
done
|
|
|
|
RUN for d in lib/modules/*; do depmod -b . $(basename $d); done
|
|
|
|
RUN mkdir /out
|
|
# With some fedora rpms, the kernel and system map are in modules directory
|
|
RUN cp -a boot/vmlinuz-* /out/kernel || mv lib/modules/*/vmlinuz /out/kernel
|
|
RUN cp -a boot/config-* /out/kernel_config || mv lib/modules/*/config /out/kernel_config
|
|
RUN cp -a boot/System.map-* /out/System.map || mv lib/modules/*/System.map /out/System.map
|
|
RUN tar cf /out/kernel.tar lib
|
|
RUN tar cf /out/kernel-dev.tar usr || true
|
|
|
|
FROM linuxkit/toybox-media:d7e82a7d19ccc84c9071fa7a88ecaa58ae958f7c@sha256:4c7d25f2be2429cd08417c36e04161cb924e46f3e419ee33a0aa9ff3a0942e02
|
|
WORKDIR /
|
|
ENTRYPOINT []
|
|
CMD []
|
|
COPY --from=extract /out/* /
|