ARG R_VERSION=latest
FROM rocker/verse:${R_VERSION}

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        libomp-dev && \
    git clone \
        --recursive \
        --branch stable \
        --depth 1 https://github.com/Microsoft/LightGBM && \
    cd ./LightGBM && \
    sh build-cran-package.sh --no-build-vignettes && \
    R CMD INSTALL ./lightgbm_*.tar.gz && \
    cd .. && \
    rm -rf ./LightGBM
