thealgorithms-c-plus-plus
SUCCESS
9m 12s
History Source
SummaryIterations1Transcript8Dockerfile
Dockerfile27 lines · 651 chars
# Base image
FROM ubuntu:jammy-20260210.1

ENV DEBIAN_FRONTEND=noninteractive

# Install build dependencies (OpenMP is optional, but libomp is useful)
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential cmake libomp-dev doxygen graphviz \
    && rm -rf /var/lib/apt/lists/*

# Copy source and build from source
WORKDIR /src
COPY . /src

# Configure and build
RUN cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
RUN cmake --build build --parallel 4
RUN cmake --install build

# Create a non-root user for running the container
RUN useradd -m appuser
USER appuser

# Default command
CMD ["/bin/bash"]