# Build from source using a two-stage Docker build for tinyraycaster
# Stage 1: builder with dev tools to compile the project
FROM debian:oldstable-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies (CMake + SDL2 and common dev tools)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
libsdl2-dev \
netpbm \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy source and build
COPY . .
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
# Stage 2: runtime image
FROM debian:oldstable-slim
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies (SDL2 runtime, etc.)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libsdl2-2.0-0 \
netpbm \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder
COPY --from=builder /src/build/tinyraycaster /tinyraycaster
WORKDIR /
# Run the application (requires a display server for SDL)
CMD ["/tinyraycaster"]
# Ignore git and build artifacts .git build Dockerfile .dockerignore *.o *.a *.so **/build/
Smoke [PASS]: test -x /tinyraycaster Smoke [PASS]: ldd /tinyraycaster | grep -q libSDL2 Smoke [FAIL]: file /tinyraycaster | grep -q 'executable Output: sh: 1: Syntax error: Unterminated quoted string
# Build from source using a two-stage Docker build for tinyraycaster
# Stage 1: builder with dev tools to compile the project
FROM debian:oldstable-slim AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies (CMake + SDL2 and common dev tools)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
cmake \
libsdl2-dev \
netpbm \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy source and build
COPY . .
RUN mkdir -p build && cd build && cmake .. && make -j$(nproc)
# Stage 2: runtime image
FROM debian:oldstable-slim
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies (SDL2 runtime, etc.)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libsdl2-2.0-0 \
netpbm \
file \
&& rm -rf /var/lib/apt/lists/*
# Copy the built binary from the builder
COPY --from=builder /src/build/tinyraycaster /tinyraycaster
WORKDIR /
# Run the application (requires a display server for SDL)
CMD ["/tinyraycaster"]
Smoke [PASS]: test -x /tinyraycaster Smoke [PASS]: ldd /tinyraycaster | head -n 20 Smoke [PASS]: file /tinyraycaster