first commit
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
FROM eclipse-temurin:17-jdk-jammy
|
||||
|
||||
# Install required dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
unzip \
|
||||
git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set environment variables
|
||||
ENV ANDROID_HOME=/opt/android-sdk
|
||||
ENV PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
|
||||
|
||||
# Download and install Android command line tools
|
||||
RUN mkdir -p $ANDROID_HOME/cmdline-tools && \
|
||||
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdline-tools.zip && \
|
||||
unzip -q /tmp/cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools && \
|
||||
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest && \
|
||||
rm /tmp/cmdline-tools.zip
|
||||
|
||||
# Accept licenses and install required SDK components
|
||||
RUN yes | sdkmanager --licenses && \
|
||||
sdkmanager "platform-tools" "platforms;android-34" "build-tools;34.0.0"
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy project files
|
||||
COPY . .
|
||||
|
||||
# Make gradlew executable
|
||||
RUN chmod +x gradlew
|
||||
|
||||
# Build the APK
|
||||
CMD ["./gradlew", "assembleDebug", "--no-daemon"]
|
||||
Reference in New Issue
Block a user