Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [docker] [ci] fix dockerfiles, test docker builds in CI #6638

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[docker] fix dockerfiles, test docker builds in CI
  • Loading branch information
jameslamb committed Sep 3, 2024
commit 46a8cc71b7744df657eb97e5db0fc75e401934c9
14 changes: 7 additions & 7 deletions docker/dockerfile-cli
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

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

ARG LIGHTGBM_GIT_REF=stable

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

RUN curl -L -o cmake.sh https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-linux-x86_64.sh && \
RUN curl -L -o cmake.sh https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-linux-$(arch).sh && \
chmod +x cmake.sh && \
sh ./cmake.sh --prefix=/usr/local --skip-license && \
rm cmake.sh

RUN git clone \
--recursive \
--branch stable \
--branch ${LIGHTGBM_GIT_REF} \
--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
cd .. && \
rm -rf ./LightGBM

ENTRYPOINT ["lightgbm"]
13 changes: 6 additions & 7 deletions docker/dockerfile-python
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

ARG CONDA_DIR=/opt/miniforge
ARG LIGHTGBM_GIT_REF=stable

ENV \
DEBIAN_FRONTEND=noninteractive \
@@ -13,22 +14,20 @@ RUN apt-get update && \
ca-certificates \
cmake \
build-essential \
gcc \
g++ \
curl \
git \
libomp-dev && \
# python environment
curl -sL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh && \
curl -sL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-$(arch).sh -o miniforge.sh && \
/bin/bash miniforge.sh -f -b -p $CONDA_DIR && \
export PATH="$CONDA_DIR/bin:$PATH" && \
conda config --set always_yes yes --set changeps1 no && \
# lightgbm
conda install -q -y numpy scipy scikit-learn pandas && \
git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \
git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \
cd ./LightGBM && \
sh ./build-python.sh install && \
# clean
apt-get autoremove -y && apt-get clean && \
conda clean -a -y && \
rm -rf /usr/local/src/*
cd .. && \
rm -rf ./LightGBM
6 changes: 4 additions & 2 deletions docker/dockerfile-r
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
ARG R_VERSION=latest
FROM rocker/verse:${R_VERSION}

ARG LIGHTGBM_GIT_REF=stable

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