Skip to content

Commit

Permalink
feat: android image builder dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed Oct 8, 2023
1 parent 17b385a commit ccbdd5a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docker/dev-builder/android/Dockerfile
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"]

0 comments on commit ccbdd5a

Please sign in to comment.