dockerfile-python 1019 Bytes
Newer Older
1
FROM ubuntu:20.04
wxchan's avatar
wxchan committed
2

3
ARG CONDA_DIR=/opt/miniforge
4
5
6
7
8
9

ENV \
    DEBIAN_FRONTEND=noninteractive \
    LANG=C.UTF-8 \
    LC_ALL=C.UTF-8 \
    PATH=$CONDA_DIR/bin:$PATH
Nikita Titov's avatar
Nikita Titov committed
10

wxchan's avatar
wxchan committed
11
RUN apt-get update && \
Nikita Titov's avatar
Nikita Titov committed
12
    apt-get install -y --no-install-recommends \
13
        ca-certificates \
Nikita Titov's avatar
Nikita Titov committed
14
15
16
17
        cmake \
        build-essential \
        gcc \
        g++ \
18
        curl \
19
20
        git \
        libomp-dev && \
21
    # python environment
22
23
    curl -sL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -o miniforge.sh && \
    /bin/bash miniforge.sh -f -b -p $CONDA_DIR && \
Nikita Titov's avatar
Nikita Titov committed
24
    export PATH="$CONDA_DIR/bin:$PATH" && \
Nikita Titov's avatar
Nikita Titov committed
25
    conda config --set always_yes yes --set changeps1 no && \
wxchan's avatar
wxchan committed
26
    # lightgbm
27
    conda install -q -y numpy scipy scikit-learn pandas && \
Nikita Titov's avatar
Nikita Titov committed
28
    git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \
29
    sh ./build-python.sh install && \
30
    # clean
wxchan's avatar
wxchan committed
31
    apt-get autoremove -y && apt-get clean && \
Nikita Titov's avatar
Nikita Titov committed
32
    conda clean -a -y && \
wxchan's avatar
wxchan committed
33
    rm -rf /usr/local/src/*