052cc4fb638e303fd39552ca9d04de72fa4403e5
[platform/core/ml/nnfw.git] / infra / docker / xenial / Dockerfile
1 FROM ubuntu:16.04
2
3 ARG UBUNTU_MIRROR
4
5 RUN if [ -n "$http_proxy" ] ; then echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf ; fi
6 RUN if [ -n "$https_proxy" ] ; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf ; fi
7 RUN if [ -n "$UBUNTU_MIRROR" ] ; then sed "s/archive.ubuntu.com/${UBUNTU_MIRROR}/g" -i /etc/apt/sources.list ; fi
8
9 # Install 'add-apt-repository'
10 RUN apt-get update && apt-get -qqy install software-properties-common
11
12 # Build tool
13 RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov
14
15 # Install extra dependencies (Caffe, nnkit)
16 RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev
17
18 # Install protocol buffer
19 RUN apt-get update && apt-get -qqy install libprotobuf-dev protobuf-compiler
20
21 # Additonal tools
22 RUN apt-get update && apt-get -qqy install doxygen graphviz wget unzip clang-format-3.9 python3 python3-pip python3-venv hdf5-tools pylint
23 RUN pip3 install --upgrade pip
24 RUN pip3 install yapf==0.22.0 numpy
25
26 # Install google test (source)
27 RUN apt-get update && apt-get -qqy install libgtest-dev
28
29 ###
30 ### NOTE: Don't add new package install using apt-get or pip below this line
31 ###
32
33 # Install native build tool gcc version 6.x
34 RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get -qqy install gcc-6 g++-6
35 RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && update-alternatives --config gcc
36
37 # Install cross build tool gcc version 6.x
38 RUN wget https://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz -O gcc-hardfp.tar.xz -nv
39 RUN wget https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabi/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabi.tar.xz -O gcc-softfp.tar.xz -nv
40 RUN wget https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/aarch64-linux-gnu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz -O gcc-aarch64.tar.xz -nv
41 RUN tar -xf gcc-hardfp.tar.xz -C /opt/ && rm -rf gcc-hardfp.tar.xz
42 RUN tar -xf gcc-softfp.tar.xz -C /opt/ && rm -rf gcc-softfp.tar.xz
43 RUN tar -xf gcc-aarch64.tar.xz -C /opt/ && rm -rf gcc-aarch64.tar.xz
44 ENV PATH "/opt/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabi/bin:/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin:/opt/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin:$PATH"
45
46 ###
47 ### NOTE: Don't add build & install process using installed buildtool above this line
48 ###
49
50 # Build and install google test static libraries
51 WORKDIR /root/gtest
52 RUN cmake /usr/src/gtest
53 RUN make
54 RUN mv *.a /usr/lib
55 WORKDIR /root
56 RUN rm -rf gtest
57
58 # Install gbs & sdb
59 RUN echo 'deb [trusted=yes] http://download.tizen.org/tools/latest-release/Ubuntu_16.04/ /' | cat >> /etc/apt/sources.list
60 RUN apt-get update && apt-get -qqy install gbs
61 RUN wget http://download.tizen.org/sdk/tizenstudio/official/binary/sdb_3.1.4_ubuntu-64.zip -O sdb.zip
62 RUN unzip -d tmp sdb.zip && rm sdb.zip
63 RUN cp tmp/data/tools/sdb /usr/bin/. && rm -rf tmp
64
65 # Clean archives (to reduce image size)
66 RUN apt-get clean -y