-
Notifications
You must be signed in to change notification settings - Fork 7
/
complexity-test-images
52 lines (44 loc) · 1.74 KB
/
complexity-test-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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# syntax=docker/dockerfile:1.3-labs
# vim: set ft=dockerfile:
ARG ROOT_IMAGES_TAG=20240305.092417
# override this with --build-arg
ARG KERNEL_VER=bpf-next
ARG KERNEL_IMAGE_TAG=bpf-next
FROM quay.io/lvh-images/root-images-ci:"${ROOT_IMAGES_TAG}" AS root-images
FROM quay.io/lvh-images/kernel-images-ci:"${KERNEL_IMAGE_TAG}" AS kimg
FROM quay.io/lvh-images/lvh:v0.0.19 AS lvh
FROM ubuntu:rolling AS builder
ARG KERNEL_VER=bpf-next
WORKDIR /data
COPY --from=lvh /usr/bin/lvh /usr/bin/lvh
RUN apt-get update --quiet && \
apt-get upgrade --quiet --yes && \
apt-get install --quiet --yes --no-install-recommends \
zstd qemu-utils libguestfs-tools linux-image-generic
COPY --from=kimg /data/kernels /data/kernels
COPY --from=root-images /data/images/complexity-test.qcow2.zst /data/images/complexity-test.qcow2.zst
RUN zstd --decompress --rm --threads=0 /data/images/complexity-test.qcow2.zst
COPY <<EOF /data/images.json
[
{
\"name\": \"complexity-test_"${KERNEL_VER}".qcow2\",
\"parent\": \"complexity-test.qcow2\",
\"actions\": [
{
\"comment\": \"install "${KERNEL_VER}"\",
\"op\": {
\"KernelInstallDir\": \"/data/kernels/"${KERNEL_VER}"\"
},
\"type\": \"install-kernel\"
},
{ \"op\": { \"Hostname\": \"complexity-test-"${KERNEL_VER}"\"}, \"type\": \"set-hostname\" }
]
}
]
EOF
# mmdebstrap outputs messages in stderr, so we redirect stderr
RUN lvh images build --image complexity-test_${KERNEL_VER}.qcow2 --dir /data 2>&1
RUN zstd --compress --rm --threads=0 /data/images/complexity-test_${KERNEL_VER}.qcow2
RUN rm /data/images/*.qcow2
FROM busybox
COPY --from=builder /data/images /data/images