--build-arg

Signed-off-by: ale <ale@manalejandro.com>
This commit is contained in:
ale 2025-01-20 11:46:16 +01:00
parent 1601787db7
commit 6d1d969e3c
Signed by: ale
GPG Key ID: 244A9C4DAB1C0C81
2 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,6 @@
FROM debian:${DISTRIBUTION:-bookworm}
ENV VERSION=${VERSION:-6.12.10}
ARG DISTRIBUTION=${DISTRIBUTION:-bookworm}
FROM debian:$DISTRIBUTION
ARG VERSION=${VERSION:-6.12}
RUN apt update && apt install -y build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison wget debhelper python3 && apt clean
WORKDIR /usr/src
RUN wget https://git.kernel.org/torvalds/t/linux-$VERSION.tar.gz && tar xavf /usr/src/linux-$VERSION.tar.gz && rm -f linux-$VERSION.tar.gz

View File

@ -5,16 +5,16 @@
## Configure environment
$ export DISTRIBUTION=bookworm
$ export VERSION=6.12.10
$ export VERSION=6.12
Copy your kernel config to the `config` file
## Build image
$ docker buildx build -e DISTRIBUTION=$DISTRIBUTION -e VERSION=$VERSION -t docker-deb-kernel .
$ docker buildx build --build-arg DISTRIBUTION=bookworm --build-arg VERSION=6.12 -t docker-deb-kernel .
## Extract .deb packages from container
$ docker run -d --rm --name ddk -v ./:/mnt docker-deb-kernel find /usr/src -iname *.deb -exec cp {} /mnt \;
$ docker run -d --rm --name ddk -v ./:/local docker-deb-kernel find /usr/src -iname *.deb -exec cp {} /local \;
## Install .deb packages