-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (32 loc) · 919 Bytes
/
Dockerfile
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
# This is a multi-stage dockerfile.
# * stage1 - Create a base image to build the kernel in
# * stage2 - Build the kernel in the stage1 image
# * export-stage - Export the final files from stage2 to the host
FROM ubuntu:18.04 as stage1
RUN apt update && \
echo "no" | apt install -y \
build-essential \
wget \
bison \
flex \
python3 \
nasm \
xorriso
# Download and build grub2
RUN wget ftp://ftp.gnu.org/gnu/grub/grub-2.04.tar.gz
RUN zcat grub-2.04.tar.gz | tar xvf -
RUN cd grub-2.04 && \
./configure && \
make install
FROM stage1 as stage2
ARG CACHEBUST=1
WORKDIR /app
COPY asm asm
COPY isofiles isofiles
COPY Makefile Makefile
RUN make .iso-in-docker
FROM scratch AS export-stage
COPY --from=stage2 /app/asm/uefi_header.o .
COPY --from=stage2 /app/asm/boot.o .
COPY --from=stage2 /app/out/kernel.bin .
COPY --from=stage2 /app/os.iso .