Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Changing Dockerfile to use Alpine Linux python images #31

Merged
merged 1 commit into from
Jul 27, 2019
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM ubuntu:16.04
############################################################
FROM python:2-alpine3.10
# To use python3 comment the line above and uncomment
# the line bellow.
#FROM python:3-alpine3.10
############################################################

MAINTAINER {{mantainer.email}}

Expand All @@ -21,6 +26,7 @@ ENV HADOOP_CONF_DIR=$SPARK_CONF_DIR
ENV YARN_CONF_DIR=$SPARK_CONF_DIR



##############################################################
# Create all folders needed
##############################################################
Expand All @@ -29,76 +35,71 @@ RUN mkdir -p $MARVIN_HOME && \
mkdir -p $MARVIN_DATA_PATH && \
mkdir -p $MARVIN_ENGINE_HOME && \
mkdir -p /var/log/marvin/engines && \
mkdir -p /var/run/marvin/engines


mkdir -p /var/run/marvin/engines && \
##############################################################
# Install the system dependencies for default installation
##############################################################

RUN apt-get update -y && \
apt-get install -y build-essential && \
apt-get install -y maven git python cmake software-properties-common curl libstdc++6 && \
apt-get install -y git && \
apt-get install -y wget && \
apt-get install -y python2.7-dev && \
apt-get install -y python-pip && \
apt-get install -y ipython && \
apt-get install -y libffi-dev && \
apt-get install -y libssl-dev && \
apt-get install -y libxml2-dev && \
apt-get install -y libxslt1-dev && \
apt-get install -y libpng12-dev && \
apt-get install -y libfreetype6-dev && \
apt-get install -y python-tk && \
apt-get install -y libsasl2-dev && \
apt-get install -y python-pip && \
apt-get install -y graphviz && \
pip install --upgrade pip && \
apt-get clean

RUN pip install virtualenvwrapper

# Install Open JDK
RUN apt-get update && apt-get install -y openjdk-8-jdk


apk add --no-cache g++ openssl-dev openjdk11-jre-headless bash && \
apk add --no-cache --virtual .build-deps make \
git \
wget \
libsass-dev \
openblas-dev \
libffi-dev \
libxml2-dev \
libxslt-dev \
libpng-dev \
freetype-dev \
cyrus-sasl-dev
##############################################################
# Install Apache Spark
#
# Uncomment if you are using spark, note that is needed the
# spark configuration files to the think works correctly.
##############################################################

RUN mkdir -p $SPARK_CONF_DIR

##############################################################
# Create the virtualenv configuration
#
# RUN wget -O /tmp/spark-2.1.1-bin-hadoop2.6.tgz https://d3kbcqa49mib13.cloudfront.net/spark-2.1.1-bin-hadoop2.6.tgz && \
# tar -xf /tmp/spark-2.1.1-bin-hadoop2.6.tgz -C /opt/ && \
# ln -s /opt/spark-2.1.1-bin-hadoop2.6 /opt/spark
##############################################################

RUN /bin/bash -c "cd $MARVIN_ENGINE_HOME && \
source /usr/local/bin/virtualenvwrapper.sh && \
mkvirtualenv $MARVIN_ENGINE_ENV"

RUN mkdir -p $SPARK_CONF_DIR

##############################################################
# <CUSTOM ENGINE INSTALLATION PROCEDURE HERE> #
##############################################################


##############################################################
# Copy and Install the marvin engine inside virtualenv
# Copy and Install the marvin engine
##############################################################

RUN /bin/bash -c "pip install virtualenvwrapper && \
cd $MARVIN_ENGINE_HOME && \
source /usr/local/bin/virtualenvwrapper.sh && \
mkvirtualenv $MARVIN_ENGINE_ENV"

ADD build/engine.tar $MARVIN_ENGINE_HOME

ADD build/marvin-engine-executor-assembly.jar $MARVIN_DATA_PATH

RUN /bin/bash -c "source /usr/local/bin/virtualenvwrapper.sh && \
workon $MARVIN_ENGINE_ENV && \
cd $MARVIN_ENGINE_HOME && \
pip install --no-cache numpy && \
pip install --no-cache scipy && \
pip install --no-cache pandas && \
pip install --no-cache matplotlib && \
pip install --no-cache cython && \
pip install --no-cache scikit-learn && \
pip install --no-cache Fabric && \
pip install --no-cache marvin-python-toolbox && \
pip install . "

##############################################################
# Uninstalling unnecessary software and cleaning cache
##############################################################
RUN rm -rf /root/.cache && \
apk del .build-deps

##############################################################
# Starts the engine http server
Expand Down