-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
35 lines (26 loc) · 1.01 KB
/
Dockerfile
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
FROM ubuntu:22.04 AS base
RUN apt update && apt install -y openjdk-17-jdk openjdk-17-jre android-sdk sdkmanager
WORKDIR /android
COPY . .
ENV ANDROID_HOME "/usr/lib/android-sdk/"
ENV PATH "${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platforms-tools/"
# ENV GRADLE_OPTS "-Xmx2048m"
RUN yes | sdkmanager --licenses
ENV PASS=""
ENV MIN_SDK=""
# CMD ./gradlew assembleDebug
FROM base as apk-builder
CMD ./gradlew assembleRelease && \
apksigner sign --ks app/keys/app-release-key.jks \
--ks-pass pass:$PASS \
--in app/build/outputs/apk/release/app-release-unsigned.apk \
--out app/build/outputs/apk/release/app-release.apk
FROM base as bundle-builder
CMD ./gradlew assemble bundleRelease && \
apksigner sign --ks app/keys/app-release-key.jks \
--ks-pass pass:$PASS \
--in app/build/outputs/bundle/release/app-release.aab \
--out app/build/outputs/bundle/release/app-bundle.aab \
--min-sdk-version $MIN_SDK
# CMD cp app/build/outputs/apk/debug/app-debug.apk /apkbuilds/
# CMD sha256sum app/build/outputs/apk/debug/app-debug.apk