-
Notifications
You must be signed in to change notification settings - Fork 158
/
Dockerfile.release
41 lines (31 loc) · 1.59 KB
/
Dockerfile.release
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
FROM mingc/android-build-box:1.24.0
ARG ORG_GRADLE_PROJECT_RELEASE_STORE_FILE
ARG ORG_GRADLE_PROJECT_RELEASE_STORE_PASSWORD
ARG ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS
ARG ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD
ARG ORG_GRADLE_PROJECT_MAPBOX_DOWNLOADS_TOKEN
RUN mkdir /app
WORKDIR /app
# rm the NDK because it breaks the build
RUN rm -rf /opt/android-sdk/ndk/current
RUN rm -rf /opt/android-sdk/ndk/23.1.7779620
COPY ./gradle /app/gradle
COPY ./gradlew /app
COPY ./gradle.properties /app
COPY ./settings.gradle /app
COPY ./build.gradle /app
COPY ./lcs-keystore /app/lcs-keystore
# add a step that downloads the latest gradle wrapper before the actual build
#RUN ./gradlew help
COPY . /app
# use the following as --build-arg variables:
# ORG_GRADLE_PROJECT_RELEASE_STORE_FILE=/app/lcs-keystore
# ORG_GRADLE_PROJECT_RELEASE_STORE_PASSWORD=<pw>
# ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS=<alias>
# ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD=<pw>
RUN ./gradlew --no-daemon assembleRelease
# build the image with:
# docker build --build-arg ORG_GRADLE_PROJECT_RELEASE_STORE_FILE=/app/lcs-keystore --build-arg ORG_GRADLE_PROJECT_RELEASE_STORE_PASSWORD=<pw> --build-arg ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS=<alias> --build-arg ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD=<pw> --build-arg ORG_GRADLE_PROJECT_MAPBOX_DOWNLOADS_TOKEN=<mapbox-api-token> -t envirocar-app-release:latest -f Dockerfile.release .
#
# to copy the final APK from the image to the host path /tmp/envirocar:
# docker run --rm -v /tmp/envirocar:/mnt/out envirocar-app-release:latest cp /app/org.envirocar.app/build/outputs/apk/release/org.envirocar.app-release.apk /mnt/out