use udev for lvm & net

This commit is contained in:
Mikaël Cluseau
2024-11-04 16:18:53 +01:00
parent 7325ee1c0c
commit 0f9679d91e
6 changed files with 142 additions and 72 deletions

View File

@ -1,9 +1,11 @@
from golang:1.21.6-alpine3.19 as build
from golang:1.23.2-alpine3.20 as build
run apk add --no-cache gcc musl-dev linux-headers eudev-dev
workdir /src
copy . .
env CGO_ENABLED=1
run \
--mount=type=cache,id=gomod,target=/go/pkg/mod \
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
@ -11,7 +13,7 @@ run \
&& go build -o /go/bin/init -trimpath .
# ------------------------------------------------------------------------
from alpine:3.19.0 as initrd
from alpine:3.20.3 as initrd
run apk add --no-cache xz
@ -30,6 +32,6 @@ run chroot /layer /init hello
run find |cpio -H newc -o >/initrd
# ------------------------------------------------------------------------
from alpine:3.19.0
from alpine:3.20.3
copy --from=initrd /initrd /
entrypoint ["base64","/initrd"]