FROM ubuntu:18.04

# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install essential build tools
RUN apt-get update && \
    apt-get install -y \
    build-essential \
    git \
    wget \
    software-properties-common \
    gpg \
    ca-certificates \
    curl \
    patchelf


# Install the latest CMake
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null && \
    apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
    apt-get update && \
    apt-get install -y cmake

# Set working directory
WORKDIR /build

# Default command (can be overridden)
CMD ["make", "linux_x64"]
