Dockerfile.android 1.4 KB
Newer Older
1 2 3 4 5 6 7 8
FROM ubuntu:16.04
MAINTAINER PaddlePaddle Authors <paddle-dev@baidu.com>

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'

ENV HOME=/root \
    ANDROID_NDK_HOME=/opt/android-ndk-linux \
9
    ANDROID_STANDALONE_TOOLCHAIN=/opt/android-toolchain-gcc
10 11

RUN apt-get update && \
L
Liu Yiqun 已提交
12 13 14
    apt-get install -y \
    git python-dev python-pip python-numpy \
    wget curl tar unzip gcc g++ locales clang-format-3.8 swig cmake && \
15 16 17 18 19 20 21 22
    apt-get clean -y

# git credential to skip password typing
RUN git config --global credential.helper store

# Fix locales to en_US.UTF-8
RUN localedef -i en_US -f UTF-8 en_US.UTF-8

L
Liu Yiqun 已提交
23 24 25 26
RUN pip install --upgrade pip && \
    pip install -U 'protobuf==3.1.0' && \
    pip install -U wheel sphinx && \
    pip install pre-commit
27 28 29 30 31 32 33 34

# Android NDK
RUN mkdir /opt/android-ndk-tmp && \
    cd /opt/android-ndk-tmp && \
    wget -q https://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip && \
    unzip -q android-ndk-r14b-linux-x86_64.zip && \
    mv android-ndk-r14b ${ANDROID_NDK_HOME} && \
    ${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain.sh --arch=arm --platform=android-21 --install-dir=${ANDROID_STANDALONE_TOOLCHAIN} && \
35 36
    rm -rf /opt/android-ndk-tmp && \
    rm -rf ${ANDROID_NDK_HOME}
37

L
Liu Yiqun 已提交
38
CMD ["bash", "/paddle/paddle/scripts/docker/build_android.sh"]