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 && \
    mkdir LightGBM/build && \
    cd LightGBM/build && \
    cmake .. && \
    make -j4 && \
    make install && \
    cd "${HOME}" && \
    rm -rf LightGBM

ENTRYPOINT ["lightgbm"]
