# Use Ubuntu 18.04 as the base image
FROM ubuntu:18.04

# Proxy settings
ARG https_proxy
ARG http_proxy
ARG all_proxy

# Base packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        software-properties-common \
        wget \
        curl \
        git \
        vim \
        ca-certificates \
        openssl && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install CMake 3.20.6
RUN cd /opt && \
    wget https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6-linux-x86_64.tar.gz && \
    tar -zxvf cmake-3.20.6-linux-x86_64.tar.gz && \
    ln -s /opt/cmake-3.20.6-linux-x86_64/bin/* /usr/local/bin/ && \
    rm cmake-3.20.6-linux-x86_64.tar.gz

# Set the working directory
WORKDIR /workspace

# Default to running Bash
CMD ["/bin/bash"]
