FROM ubuntu:20.04

ENV \
    DEBIAN_FRONTEND=noninteractive \
    LANG=C.UTF-8 \
    LC_ALL=C.UTF-8

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        cmake \
        build-essential \
        gcc \
        g++ \
        git \
        libomp-dev && \
    rm -rf /var/lib/apt/lists/*

RUN git clone \
        --recursive \
        --branch stable \
        --depth 1 \
        https://github.com/Microsoft/LightGBM && \
    cd ./Lightgbm && \
    cmake -B build -S . && \
    cmake --build build -j4 && \
    cmake --install build && \
    cd "${HOME}" && \
    rm -rf LightGBM

ENTRYPOINT ["lightgbm"]
