Add Dockerfile for android targets

Former-commit-id: 97d399e200cef304b1d76b099d7449b4a8f33a0b
Former-commit-id: 842c1a99e6ac83f4caf90560167b8ddb57c8c93d
This commit is contained in:
Michel Heily 2021-06-05 20:26:48 +03:00
parent 20506091cc
commit 67c071595a

34
Dockerfile.android Normal file
View file

@ -0,0 +1,34 @@
FROM npetrovsky/docker-android-sdk-ndk
# Update default packages
RUN apt-get update
# Get Ubuntu packages
RUN apt-get install -y \
build-essential \
curl
# Update new packages
RUN apt-get update
# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
RUN . $HOME/.cargo/env && rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
ENV NDK=$ANDROID_HOME/ndk-bundle
RUN echo \
'[target.aarch64-linux-android]\n'\
'ar = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/aarch64-linux-android/bin/ar "\n'\
'linker = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang"\n'\
\
'[target.armv7-linux-androideabi]\n'\
'ar = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/arm-linux-androideabi/bin/ar "\n'\
'linker = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang"\n'\
\
'[target.i686-linux-android]\n'\
'ar = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/i386-linux-android/bin/ar"\n'\
'linker = "/opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang"' > $HOME/.cargo/config