-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.qemu-xen
86 lines (77 loc) · 4.01 KB
/
Dockerfile.qemu-xen
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
FROM alpine:3.21@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 AS build
ARG XEN_VERSION=4.19.1
WORKDIR /usr/src
# build dependencies
RUN apk update && apk add build-base git flex bison perl bash coreutils argp-standalone attr-dev curl-dev linux-headers openssl-dev python3-dev xz-dev ocaml ocamlbuild ocaml-ocamldoc dev86 iasl util-linux-dev py3-setuptools ncurses-dev spice-dev xz-dev yajl-dev zlib-dev zstd-dev perl-dev openssl-dev e2fsprogs-dev curl-dev attr-dev dtc-dev meson samurai patchelf
# check out xen sources
ENV XEN_VERSION=${XEN_VERSION}
RUN git clone -b "RELEASE-$XEN_VERSION" https://github.com/xen-project/xen.git && cd xen
WORKDIR /usr/src/xen
COPY ./patches-oxenstored ./patches-oxenstored
# configure Xen build system
RUN ./configure --prefix=/opt/edera/qemu-xen --disable-xen --enable-tools --disable-stubdom --disable-docs
# patch build system
RUN for patch in patches-oxenstored/*.patch; do patch -p1 < $patch; done
# build libraries
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/include all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/call all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/ctrl all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/devicemodel all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/foreignmemory all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/gnttab all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/guest all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/evtchn all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/toolcore all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/toollog all V=1 nosharedlibs=y
RUN CFLAGS="-O2 -Wall -static -DUSE_PTHREAD" make -j$(nproc) -C tools/libs/store all V=1 nosharedlibs=y
WORKDIR /usr/src
RUN git clone -b edera https://github.com/edera-dev/qemu.git qemu-xen
WORKDIR /usr/src/qemu-xen
COPY ./build-qemu.sh .
RUN sh build-qemu.sh
FROM alpine:3.21@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 AS chroot
RUN mkdir -p /opt/edera/qemu-xen/sysroot && apk update && apk add --root /opt/edera/qemu-xen/sysroot --initdb && \
cp /etc/apk/repositories /opt/edera/qemu-xen/sysroot/etc/apk/repositories && \
cp -R /etc/apk/keys /opt/edera/qemu-xen/sysroot/etc/apk/keys && \
apk add --root /opt/edera/qemu-xen/sysroot \
so:libpixman-1.so.0 \
so:libz.so.1 \
so:libjpeg.so.8 \
so:libsasl2.so.3 \
so:libfdt.so.1 \
so:libgio-2.0.so.0 \
so:libgobject-2.0.so.0 \
so:libglib-2.0.so.0 \
so:libzstd.so.1 \
so:libncursesw.so.6 \
so:libgmodule-2.0.so.0 \
so:libspice-server.so.1 \
so:libcurl.so.4 \
so:libbz2.so.1 \
so:libmount.so.1 \
so:libintl.so.8 \
so:libffi.so.8 \
so:libpcre2-8.so.0 \
so:libssl.so.3 \
so:libcrypto.so.3 \
so:libopus.so.0 \
so:libgstreamer-1.0.so.0 \
so:libgstapp-1.0.so.0 \
so:liborc-0.4.so.0 \
so:liblz4.so.1 \
so:libstdc++.so.6 \
so:libcares.so.2 \
so:libnghttp2.so.14 \
so:libidn2.so.0 \
so:libpsl.so.5 \
so:libbrotlidec.so.1 \
so:libblkid.so.1 \
so:libgstbase-1.0.so.0 \
so:libgcc_s.so.1 \
so:libunistring.so.5 \
so:libbrotlicommon.so.1 \
so:libeconf.so.0
RUN printf "/opt/edera/qemu-xen/sysroot/lib\n/opt/edera/qemu-xen/sysroot/usr/lib\n" > /opt/edera/qemu-xen/sysroot/etc/ld-musl-$(apk --print-arch).path
FROM scratch AS final
COPY --from=build /usr/src/qemu-xen/output/opt/edera/qemu-xen /opt/edera/qemu-xen
COPY --from=chroot /opt/edera/qemu-xen/sysroot /opt/edera/qemu-xen/sysroot