-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.56 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Base image with Java and basic tools
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
build-essential \
openjdk-17-jdk \
unzip \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Set up environment variables
ENV JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
ENV ANDROID_SDK_ROOT="/opt/android-sdk"
ENV ANDROID_NDK_HOME="${ANDROID_SDK_ROOT}/ndk/26.1.10909125"
ENV PATH="${PATH}:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin:${ANDROID_SDK_ROOT}/platform-tools"
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Add Android targets to Rust
RUN rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
# Install cargo-ndk
RUN cargo install cargo-ndk
# Install Android SDK Command Line Tools
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \
&& curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip \
&& unzip sdk-tools.zip -d ${ANDROID_SDK_ROOT}/cmdline-tools \
&& mv ${ANDROID_SDK_ROOT}/cmdline-tools/cmdline-tools ${ANDROID_SDK_ROOT}/cmdline-tools/latest \
&& rm sdk-tools.zip
# Accept Licenses
RUN yes | sdkmanager --licenses
# Install NDK and SDK components
RUN sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0" "ndk;26.1.10909125"
# Set working directory
WORKDIR /app
# Copy project files
COPY . .
# Default command: show help
CMD ["python3", "pack.py", "--help"]