-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (51 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (51 loc) · 1.53 KB
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
# Use Ubuntu 22.04 as the base image
FROM --platform=linux/amd64 ubuntu:22.04
# Disable prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install essential tools and 32-bit support for cross-compilation
RUN apt update && apt install -y \
build-essential \
gcc \
g++ \
curl \
git \
wget \
xorriso \
mtools \
grub-common \
grub-pc-bin \
grub-efi-amd64-bin \
qemu-system-x86 \
make \
bison \
flex \
texinfo \
libgmp-dev \
libmpfr-dev \
libmpc-dev \
libisl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set up i386 cross compiler (binutils + GCC for i386)
WORKDIR /opt
RUN mkdir /cross && \
wget https://ftp.gnu.org/gnu/binutils/binutils-2.40.tar.gz && \
tar -xvzf binutils-2.40.tar.gz && \
mkdir binutils-build && \
cd binutils-build && \
../binutils-2.40/configure --target=i386-elf --prefix=/cross --disable-nls --disable-werror && \
make -j$(nproc) && \
make install
RUN wget https://ftp.gnu.org/gnu/gcc/gcc-13.1.0/gcc-13.1.0.tar.gz && \
tar -xvzf gcc-13.1.0.tar.gz && \
cd gcc-13.1.0 && ./contrib/download_prerequisites && \
mkdir ../gcc-build && \
cd ../gcc-build && \
../gcc-13.1.0/configure --target=i386-elf --prefix=/cross --disable-nls --enable-languages=c --without-headers && \
make all-gcc -j$(nproc) && \
make install-gcc
# Add cross compiler to PATH
ENV PATH="/cross/bin:$PATH"
# Default directory when the container starts
WORKDIR /SuneriOS
# Run bash shell by default
CMD ["/bin/bash"]