-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.kernel
26 lines (22 loc) · 936 Bytes
/
Dockerfile.kernel
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
FROM ubuntu:18.04 as base
RUN apt-get update
FROM base as kernel
RUN apt-get update
RUN apt-get install -y wget bc build-essential libncurses-dev bison flex libssl-dev libelf-dev openssl --no-install-recommends
ARG KERNEL=https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.8.tar.xz
ARG KERNEL_CONFIG=https://raw.githubusercontent.com/firecracker-microvm/firecracker/main/resources/guest_configs/microvm-kernel-x86_64-5.10.config
ARG PATCH_FILE=docker/config.damon.patch
WORKDIR /kernel
RUN wget --no-check-certificate -O kernel.tar.xz $KERNEL
RUN tar -xf kernel.tar.xz
RUN ln -s linux-* linux
WORKDIR linux
RUN wget --no-check-certificate -O KERNEL_CONFIG $KERNEL_CONFIG
RUN cp KERNEL_CONFIG .config
RUN make olddefconfig
# Enable DAMON*, PAGE_IDLE_FLAG, IDLE_PAGE_TRACKING, ANON_VMA_NAME
COPY /$PATCH_FILE config.patch
RUN patch .config < config.patch
RUN make vmlinux
FROM base
COPY --from=kernel /kernel/linux/vmlinux /opt/