Dockerfile43 lines · 1161 chars # Minimal multi-stage Dockerfile for FreeRTOS repository
# Stage 1: builder (install toolchain and prepare sources)
FROM ubuntu:22.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
git \
wget \
python3 \
python3-pip \
pkg-config \
gcc-arm-none-eabi \
binutils-arm-none-eabi \
make && \
rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY . /workspace
# Attempt a light build if a known demo exists; otherwise skip
RUN if [ -d FreeRTOS/Demo/ARM7_AT91FR40008_GCC ]; then \
echo "Attempting light build of ARM7_AT91FR40008_GCC..."; \
(cd FreeRTOS/Demo/ARM7_AT91FR40008_GCC && make -j$(nproc) 2>&1 | head -n 20) || true; \
else \
echo "No known demo found for light build; skipping..."; \
fi
# Stage 2: runtime image
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /workspace /workspace
WORKDIR /workspace
CMD ["bash"]