Attempt 1 #1
@@ -7,37 +7,35 @@
|
|||||||
# - CMake + Ninja for the build system
|
# - CMake + Ninja for the build system
|
||||||
# - xorriso and mtools used internally by grub-mkrescue / grub-mkimage
|
# - xorriso and mtools used internally by grub-mkrescue / grub-mkimage
|
||||||
|
|
||||||
FROM debian:bookworm-slim
|
FROM alpine:3.23
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
RUN apk add --no-cache \
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
# Core build tools
|
# Core build tools
|
||||||
clang \
|
clang \
|
||||||
lld \
|
lld \
|
||||||
cmake \
|
cmake \
|
||||||
ninja-build \
|
ninja \
|
||||||
make \
|
make \
|
||||||
git \
|
git \
|
||||||
# GRUB image generation
|
# GRUB image generation
|
||||||
grub-pc-bin \
|
grub \
|
||||||
grub-common \
|
|
||||||
xorriso \
|
xorriso \
|
||||||
mtools \
|
mtools \
|
||||||
# QEMU for running the OS
|
# QEMU for running the OS
|
||||||
qemu-system-x86 \
|
qemu-system-i386 \
|
||||||
# Handy utilities
|
# Handy utilities
|
||||||
file \
|
file \
|
||||||
ca-certificates \
|
ca-certificates
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Verify the cross-compilation toolchain can produce an i386-elf binary.
|
# Verify the cross-compilation toolchain can produce an i386-elf binary.
|
||||||
|
# Compile and link separately so ld.lld is invoked directly, avoiding the
|
||||||
|
# host gcc linker driver (which rejects -m32 on non-x86 hosts such as aarch64).
|
||||||
RUN echo 'void _start(void){for(;;)__asm__("hlt");}' > /tmp/test.c \
|
RUN echo 'void _start(void){for(;;)__asm__("hlt");}' > /tmp/test.c \
|
||||||
&& clang -target i386-elf -m32 -march=i386 -ffreestanding -fno-stack-protector \
|
&& clang -v -target i386-elf -march=i386 -ffreestanding -fno-stack-protector \
|
||||||
-nostdlib -fuse-ld=lld -Wl,-e,_start \
|
-c /tmp/test.c -o /tmp/test.o \
|
||||||
/tmp/test.c -o /tmp/test.elf \
|
&& ld.lld -m elf_i386 -e _start --nostdlib /tmp/test.o -o /tmp/test.elf \
|
||||||
&& file /tmp/test.elf | grep -q "ELF 32-bit.*80386" \
|
&& file /tmp/test.elf | grep -q "ELF 32-bit.*386" \
|
||||||
&& echo "Toolchain OK" \
|
&& echo "Toolchain OK" \
|
||||||
&& rm /tmp/test.c /tmp/test.elf
|
&& rm /tmp/test.c /tmp/test.o /tmp/test.elf
|
||||||
|
|
||||||
WORKDIR /workspaces/claude-os
|
WORKDIR /workspaces/claude-os
|
||||||
|
|||||||
Reference in New Issue
Block a user