Dockerfile.android 1.5 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 6 7 8
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'
9 10 11

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

30
RUN apt-get autoremove -y && apt-get clean
31 32 33
RUN ln -s clang-format-3.8 /usr/bin/clang-format
RUN pip install --upgrade pip
RUN pip install pre-commit wheel
34 35 36 37 38 39 40 41
RUN cd /tmp && curl -O https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip
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
ENV NDK_ROOT /opt/android-ndk-r17c
42
RUN rm -rf /tmp/android-ndk-r17c-linux-x86_64.zip /cmake-3.10.3-Linux-x86_64.tar.gz