-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: android image builder dockerfile
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM saschpe/android-ndk:34-jdk17.0.8_7-ndk25.2.9519653-cmake3.22.1 | ||
|
||
ENV LANG en_US.utf8 | ||
WORKDIR /greptimedb | ||
|
||
# Rename libunwind to libgcc | ||
RUN cp ${NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/14.0.7/lib/linux/aarch64/libunwind.a ${NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/14.0.7/lib/linux/aarch64/libgcc.a | ||
|
||
# Install dependencies. | ||
RUN apt-get update && apt-get install -y \ | ||
libssl-dev \ | ||
protobuf-compiler \ | ||
curl \ | ||
git \ | ||
build-essential \ | ||
pkg-config \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
&& pip3 install --upgrade pip \ | ||
&& pip3 install pyarrow | ||
|
||
# Trust workdir | ||
RUN git config --global --add safe.directory /greptimedb | ||
|
||
# Install Rust. | ||
SHELL ["/bin/bash", "-c"] | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y | ||
ENV PATH /root/.cargo/bin/:$PATH | ||
RUN rustup default nightly-2023-05-03 | ||
|
||
# Add android toolchains | ||
RUN rustup target add aarch64-linux-android | ||
|
||
# Install cargo-ndk | ||
RUN cargo install cargo-ndk | ||
ENV ANDROID_NDK_HOME $NDK_ROOT | ||
|
||
# Builder entrypoint. | ||
CMD ["cargo", "ndk", "--platform", "23", "-t", "aarch64-linux-android", "build", "--bin", "greptime", "--profile", "release", "--no-default-features"] |