-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.xen
30 lines (25 loc) · 1.09 KB
/
Dockerfile.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
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 python3 gnu-efi
# 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
# get rid of -Werror
RUN find . \( -name '*.mk' -o -name 'Make*' \) -exec sed -i -e 's/-Werror//g' {} +
# build Xen hypervisor
ENV CFLAGS=-Wno-error
RUN ./configure --prefix=/usr --enable-xen --disable-tools --disable-stubdom --disable-docs
COPY configs/xen-x86_64.config ./xen/.config
RUN make -C xen olddefconfig
RUN make -j$(nproc) xen
RUN make install-xen
RUN mkdir /xenboot; ([ -f /boot/xen ] && cp /boot/xen /xenboot/xen) || \
([ -f /boot/xen.gz ] && cp /boot/xen.gz /xenboot/xen.gz)
# copy final Xen hypervisor into a scratch image
FROM scratch AS final
COPY --from=build /xenboot/* /boot/
COPY --from=build /usr/lib64/efi/xen.efi /usr/share/efi/xen.efi
COPY --from=build /usr/src/xen/xen/.config /boot/xen.config