mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 09:09:57 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			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:b396a375852e5dffc002389d95e0658c8de72914@sha256:a317cc378946ee48cc011cdfc5aa08f0229f5bf10ff70e3690d8f60b36700033
 | |
| WORKDIR /
 | |
| ENTRYPOINT []
 | |
| CMD []
 | |
| COPY --from=extract /out/* /
 |