travis: improve docker images generation for building
Make a build heriarchy to reduce images size. Add Android Thing Build. Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
3d77c86634
commit
4bedd68c4e
29
docker/Dockerfile.android
Normal file
29
docker/Dockerfile.android
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM mraa-java
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
# Install CMake 3.6.2
|
||||
RUN wget -q https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.sh && \
|
||||
mkdir /opt/cmake && \
|
||||
sh /opt/cmake-3.6.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license && \
|
||||
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake && \
|
||||
cmake --version && \
|
||||
rm -fr /opt/cmake-3.6.2-Linux-x86_64.sh
|
||||
|
||||
# Android NDK build Dependencies
|
||||
RUN wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \
|
||||
unzip -qq android-ndk-r14b-linux-x86_64.zip && \
|
||||
rm -fr android-ndk-r14b-linux-x86_64.zip
|
||||
ENV NDK_HOME /opt/android-ndk-r14b
|
||||
ENV NDK_MODULE_PATH /opt/android-ndk-r14b
|
||||
|
||||
# Android Things library
|
||||
RUN wget -q https://github.com/androidthings/native-libandroidthings/archive/0.4.1-devpreview.tar.gz && \
|
||||
tar xf 0.4.1-devpreview.tar.gz && \
|
||||
rm -fr /opt/0.4.1-devpreview.tar.gz
|
||||
ENV ANDROIDTHINGS_NATIVE_LIB /opt/native-libandroidthings-0.4.1-devpreview
|
||||
|
||||
# Set Workdir
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
43
docker/Dockerfile.base
Normal file
43
docker/Dockerfile.base
Normal file
@@ -0,0 +1,43 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Update apt-get
|
||||
RUN apt-get -y update && \
|
||||
# Install apt-utils
|
||||
apt-get -y --no-install-recommends install apt-utils && \
|
||||
# Main Build Dependencies
|
||||
apt-get -y --no-install-recommends install git build-essential cmake clang-3.8 \
|
||||
g++-4.8 wget ca-certificates libpcre3 libpcre3-dev python unzip \
|
||||
# Docs Build Dependencies
|
||||
python-sphinx doxygen graphviz \
|
||||
# Json Platform Build Dependencies
|
||||
pkg-config libjson0 libjson0-dev \
|
||||
# Imraa Platform Build Dependencies
|
||||
libudev-dev \
|
||||
# Doc Build Dependencies
|
||||
python-sphinx doxygen graphviz
|
||||
|
||||
# Set library download folder to /opt
|
||||
WORKDIR /opt
|
||||
|
||||
# Swig Build Dependencies
|
||||
ARG SWIG_VERSION=3.0.10
|
||||
RUN wget -q http://iotdk.intel.com/misc/tr/swig-$SWIG_VERSION.tar.gz && \
|
||||
tar xf swig-$SWIG_VERSION.tar.gz && cd swig-$SWIG_VERSION && \
|
||||
./configure --prefix=/usr/ && make -j8 && make -j8 install && cd .. && \
|
||||
rm -fr /opt/swig-$SWIG_VERSION.tar.gz
|
||||
|
||||
# FTDI4222 Build Dependencies
|
||||
ARG FTDI4222_VERSION=linux-1.3.1.117
|
||||
RUN mkdir libft4222-$FTDI4222_VERSION && cd libft4222-$FTDI4222_VERSION && \
|
||||
wget -q http://www.ftdichip.com/Support/SoftwareExamples/libft4222-$FTDI4222_VERSION.tgz && \
|
||||
tar xf libft4222-$FTDI4222_VERSION.tgz && ./install4222.sh && \
|
||||
rm -fr libft4222-$FTDI4222_VERSION.tgz
|
||||
|
||||
# Set Workdir
|
||||
ARG MRAA_SRC_DIR=/usr/src/app
|
||||
ENV MRAA_SRC_DIR $MRAA_SRC_DIR
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
14
docker/Dockerfile.java
Normal file
14
docker/Dockerfile.java
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM mraa-base
|
||||
|
||||
# Update apt-get
|
||||
RUN apt-get -y update && \
|
||||
# Java Build Dependencies
|
||||
apt-get -y --no-install-recommends install default-jre default-jdk
|
||||
|
||||
# Set JAVA_HOME
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
|
||||
|
||||
# Set Workdir
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
16
docker/Dockerfile.node
Normal file
16
docker/Dockerfile.node
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM mraa-base
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
# Node.js Build Dependencies
|
||||
RUN wget -q -O - https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
|
||||
ENV NVM_DIR /root/.nvm
|
||||
ARG NODE_VERSION
|
||||
RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION && \
|
||||
npm install -g node-gyp && node-gyp install
|
||||
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
|
||||
|
||||
# Set Workdir
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
13
docker/Dockerfile.python
Normal file
13
docker/Dockerfile.python
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM mraa-base
|
||||
|
||||
# Update apt-get
|
||||
RUN apt-get -y update && \
|
||||
# Python 2 Build Dependencies
|
||||
apt-get -y --no-install-recommends install python python-dev \
|
||||
# Python 3 Build Dependencies
|
||||
python3 python3-dev
|
||||
|
||||
# Set Workdir
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
39
docker/Dockerfile.sonar
Normal file
39
docker/Dockerfile.sonar
Normal file
@@ -0,0 +1,39 @@
|
||||
FROM mraa-base
|
||||
|
||||
# Update apt-get
|
||||
RUN apt-get -y update && \
|
||||
# Python 2 Build Dependencies
|
||||
apt-get -y --no-install-recommends install python python-dev \
|
||||
# Python 3 Build Dependencies
|
||||
python3 python3-dev \
|
||||
# Java Build Dependencies
|
||||
default-jre default-jdk
|
||||
|
||||
# Set JAVA_HOME
|
||||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
# Node.js Build Dependencies
|
||||
RUN wget -q -O - https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
|
||||
ENV NVM_DIR /root/.nvm
|
||||
ARG NODE_VERSION
|
||||
RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use $NODE_VERSION && \
|
||||
npm install -g node-gyp && node-gyp install
|
||||
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
|
||||
|
||||
# Static Code Analysis Scanner
|
||||
ENV SONAR_DIR /opt/sonar
|
||||
ENV SONAR_VER "3.0.3.778"
|
||||
WORKDIR $SONAR_DIR
|
||||
RUN wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_VER}-linux.zip && \
|
||||
wget https://sonarqube.com/static/cpp/build-wrapper-linux-x86.zip && \
|
||||
unzip sonar-scanner-cli-${SONAR_VER}-linux.zip && \
|
||||
unzip build-wrapper-linux-x86.zip && \
|
||||
rm sonar-scanner-cli-${SONAR_VER}-linux.zip build-wrapper-linux-x86.zip
|
||||
ENV PATH $SONAR_DIR/sonar-scanner-${SONAR_VER}-linux/bin:$SONAR_DIR/build-wrapper-linux-x86:$PATH
|
||||
|
||||
# Set Workdir
|
||||
WORKDIR $MRAA_SRC_DIR
|
||||
|
||||
CMD bash
|
||||
Reference in New Issue
Block a user