Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM --platform=linux/amd64 ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
git \
curl \
build-essential \
xorriso \
net-tools \
grub-common \
grub-pc-bin \
qemu-system-x86 \
mtools \
lld \
nasm \
&& rm -rf /var/lib/apt/lists/*

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
ENV PATH="/root/.cargo/bin:${PATH}"

WORKDIR /workspace
RUN git clone https://github.com/krustowski/rou2exOS.git .

RUN sed -i 's/"target-pointer-width": "64"/"target-pointer-width": 64/' x86_64-r2.json

RUN rustup target add x86_64-unknown-none && \
cargo install bootimage --locked && \
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && \
rustup component add llvm-tools-preview --toolchain nightly-x86_64-unknown-linux-gnu

ENV RUST_BACKTRACE=1

RUN make build || echo "Build failed, but container will continue for debugging"

CMD ["bash"]
45 changes: 45 additions & 0 deletions build_and_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

echo "🚀 rou2exOS Build and Run Script"
echo "================================"

# 1. Build Docker image
echo "📦 Building Docker image..."
docker build -t rou2exos-builder .

if [ $? -ne 0 ]; then
echo "❌ Docker build failed"
exit 1
fi

# 2. Run container and copy ISO
echo "📋 Copying ISO file..."
docker run --rm -v $(pwd):/host rou2exos-builder bash -c "
if [ -f r2.iso ]; then
cp r2.iso /host/
echo '✅ ISO file copied successfully: r2.iso'
exit
else
echo '❌ ISO file not found'
ls -la
exit 1
fi
"

if [ $? -ne 0 ]; then
echo "❌ ISO copy failed"
exit 1
fi

# 3. Verify ISO file exists
if [ ! -f "r2.iso" ]; then
echo "❌ r2.iso file not found"
exit 1
fi

# 4. Run QEMU
echo "🖥️ Running rou2exOS with QEMU..."
echo "To exit: Press Ctrl+Alt+G, then type 'quit' in QEMU monitor"
qemu-system-x86_64 -boot d -cdrom r2.iso

echo "✅ Done!"