blob: 7cc3cc8d71836dd410e73cfd853f3ecebda7c8a0 [file] [log] [blame]
# *****************************************************************************
#
# Copyright (c) 2016, EPAM SYSTEMS INC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ******************************************************************************
FROM ubuntu:16.04
ARG OS
ARG SRC_PATH
# Install any .deb dependecies
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install python-pip python-dev groff vim less git wget nano libssl-dev libffi-dev libffi6 && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install any python dependencies
RUN pip install -UI pip==9.0.3 && \
pip install boto3 backoff fabric==1.14.0 fabvenv argparse ujson jupyter pycrypto google-api-python-client google-cloud-storage \
pyyaml google-auth-httplib2 oauth2client
# Configuring ssh for user
RUN mkdir -p /root/.ssh; echo "Host *" > /root/.ssh/config; \
echo "StrictHostKeyChecking no" >> /root/.ssh/config; \
echo "UserKnownHostsFile=/dev/null" >> /root/.ssh/config; \
echo "GlobalKnownHostsFile=/dev/null" >> /root/.ssh/config; \
echo "ConnectTimeout=30" >> /root/.ssh/config
# Configuring log directories
RUN mkdir -p /response; chmod a+rwx /response && \
mkdir -p /logs/ssn; chmod a+rwx /logs/ssn && \
mkdir -p /logs/edge; chmod a+rwx /logs/edge && \
mkdir -p /logs/notebook; chmod a+rwx /logs/notebook && \
mkdir -p /logs/dataengine; chmod a+rwx /logs/dataengine && \
mkdir -p /logs/dataengine-service; chmod a+rwx /logs/dataengine-service
# Copying all base scripts to docker
ENV PROVISION_CONFIG_DIR /root/conf/
ENV KEYFILE_DIR /root/keys/
RUN mkdir -p /root/conf && \
mkdir -p /root/scripts && \
mkdir -p /root/templates && \
mkdir -p /root/files && \
mkdir -p /usr/lib/python2.7/dlab && \
mkdir -p /root/keys/.ssh
COPY ${SRC_PATH}base/ /root
COPY ${SRC_PATH}general/conf/* /root/conf/
COPY ${SRC_PATH}general/api/*.py /bin/
COPY ${SRC_PATH}general/scripts/gcp/common_* /root/scripts/
COPY ${SRC_PATH}general/lib/gcp/* /usr/lib/python2.7/dlab/
COPY ${SRC_PATH}general/lib/os/${OS}/common_lib.py /usr/lib/python2.7/dlab/common_lib.py
COPY ${SRC_PATH}general/lib/os/fab.py /usr/lib/python2.7/dlab/fab.py
COPY ${SRC_PATH}general/files/os/${OS}/sources.list /root/files/
COPY ${SRC_PATH}general/files/os/ivysettings.xml /root/templates/
RUN chmod a+x /root/*.py && \
chmod a+x /root/scripts/* && \
chmod a+x /bin/*.py
ENTRYPOINT ["/root/entrypoint.py"]