Dockerfile.cross_compile 1.8 KB
Newer Older
1
# A image for building paddle cross compile
2
FROM ubuntu:16.04
3
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>
4

5
# change name to cross compile
6 7 8 9
ARG UBUNTU_MIRROR
RUN /bin/bash -c '\
if [[ -n ${UBUNTU_MIRROR} ]]; then \
sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
10 11 12

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
13 14
        clang-format-3.8 \
        cmake-curses-gui \
15
        curl \
16 17 18 19
        fish \
        gawk \
        gcc \
        g++ \
20
        git \
21
        graphviz \
22
        less \
23
        make \
24
        patch \
25 26 27
        python \
        python-pip \
        python-setuptools \
28 29 30 31
        unzip \
        vim \
        wget

32
RUN apt-get autoremove -y && apt-get clean
33 34 35
RUN ln -s clang-format-3.8 /usr/bin/clang-format
RUN pip install --upgrade pip
RUN pip install pre-commit wheel
36 37

# for cmake 3.10
38 39 40 41 42 43
RUN curl -O https://mms-res.cdn.bcebos.com/cmake-3.10.3-Linux-x86_64.tar.gz && \
        tar xzf cmake-3.10.3-Linux-x86_64.tar.gz && \
        mv cmake-3.10.3-Linux-x86_64 /opt/cmake-3.10 && \
        mv /usr/bin/cmake /usr/bin/cmake.bak && ln -s /opt/cmake-3.10/bin/cmake /usr/bin/cmake && \
        mv /usr/bin/ccmake /usr/bin/ccmake.bak && ln -s /opt/cmake-3.10/bin/ccmake /usr/bin/ccmake
RUN cd /opt && unzip /tmp/android-ndk-r17c-linux-x86_64.zip
44 45 46 47 48 49 50 51 52 53 54 55 56

# for arm linux
RUN apt-get install -y --no-install-recommends \
        g++-arm-linux-gnueabi \
        gcc-arm-linux-gnueabi \
        g++-arm-linux-gnueabihf \
        gcc-arm-linux-gnueabihf \
        gcc-aarch64-linux-gnu \
        g++-aarch64-linux-gnu 


# for android
RUN cd /tmp && curl -O https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
57
ENV NDK_ROOT /opt/android-ndk-r17c
58 59

# clean
60
RUN rm -rf /tmp/android-ndk-r17c-linux-x86_64.zip /cmake-3.10.3-Linux-x86_64.tar.gz
61