-
Notifications
You must be signed in to change notification settings - Fork 7
/
root-images
35 lines (27 loc) · 1.25 KB
/
root-images
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# vim: set ft=dockerfile:
# rebuild: 20240730.231036
ARG ROOT_BUILDER_TAG=invalid
FROM gcc:14 AS systemd-workaround-builder
COPY systemd-workaround /src
RUN make -C /src
FROM quay.io/lvh-images/root-builder-ci:"${ROOT_BUILDER_TAG}" AS builder
COPY _data /data
COPY --from=systemd-workaround-builder /src/systemd-pidfd-fix.so /data/bootstrap/systemd-pidfd-fix.so
RUN lvh version
# mmdebstrap outputs messages in stderr, so we redirect stderr
#
# You cannot use KVM during docker build anyway (without insecure option), it
# will fallback to emulation. However on arm64, libguestfs gives --machine
# gic-version=host to qemu which will fail the fallback so we need to
# explicitely tell libguestfs to use tcg
#
# for now we only build the kind image for arm64
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then lvh images build --dir /data 2>&1; fi
RUN if [ "$TARGETARCH" = "arm64" ]; then LIBGUESTFS_BACKEND_SETTINGS=force_tcg lvh images build --dir /data --image base.qcow2 --image kind.qcow2 2>&1; fi
RUN zstd --compress --rm --threads=0 /data/images/*.qcow2
# Can't use scratch here because we use `docker create` elsewhere, and
# that doesn't work without an explicit command. Satisfy this with
# busybox.
FROM busybox
COPY --from=builder /data/images /data/images