# Build an image that can do training and inference in SageMaker # This is a Python 2 image that uses the nginx, gunicorn, flask stack # for serving inferences in a stable way. FROM ubuntu:16.04 MAINTAINER Amazon AI ARG CONDA_DIR=/opt/conda ENV PATH $CONDA_DIR/bin:$PATH RUN apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ cmake \ build-essential \ gcc \ g++ \ git \ nginx \ wget && \ # python environment wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ /bin/bash Miniconda3-latest-Linux-x86_64.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 flask gevent gunicorn && \ git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ cd LightGBM/python-package && python setup.py install && \ # clean apt-get autoremove -y && apt-get clean && \ conda clean -a -y && \ rm -rf /usr/local/src/* ENV PYTHONUNBUFFERED=TRUE ENV PYTHONDONTWRITEBYTECODE=TRUE ENV PATH="/opt/program:${PATH}" # Set up the program in the image COPY lightgbm_regression /opt/program WORKDIR /opt/program