forked from xbmc/Kore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (35 loc) · 1.74 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
36
37
38
39
40
41
# Usage: docker build -t kore:latest .
# docker run -it -v $(pwd):/opt/kore kore:latest bash
# gradle
FROM ubuntu:20.04
# Install Java
ARG JDK_VERSION=17
RUN apt-get update && \
apt-get install -y --no-install-recommends openjdk-${JDK_VERSION}-jdk && \
apt-get install -y --no-install-recommends git wget unzip
# Install Gradle
# https://services.gradle.org/distributions/
ARG GRADLE_VERSION=8.4
ARG GRADLE_DIST=bin
RUN cd /opt && \
wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-${GRADLE_DIST}.zip && \
unzip gradle*.zip && \
ls -d */ | sed 's/\/*$//g' | xargs -I{} mv {} gradle && \
rm gradle*.zip
# Install Android SDK and build-tools
# https://developer.android.com/studio#command-tools
ARG ANDROID_SDK_VERSION=8512546
ENV ANDROID_SDK_ROOT /opt/android/sdk
RUN mkdir -p ${ANDROID_SDK_ROOT}/tools && \
wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
unzip *tools*linux*.zip -d ${ANDROID_SDK_ROOT} && \
rm /commandlinetools*linux*.zip
# Install Android build-tools (should match version in ./app/build.gradle)
ARG ANDROID_BUILD_TOOLS_VERSION=32.0.0
RUN yes Y | /opt/android/sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
RUN yes Y | /opt/android/sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses
# Set the environment variables
ENV JAVA_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64
ENV GRADLE_HOME /opt/gradle
ENV PATH ${PATH}:${GRADLE_HOME}/bin:${ANDROID_SDK_ROOT}/cmdline-tools/bin:${ANDROID_SDK_ROOT}/tools/bin:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/build-tools/${ANDROID_BUILD_TOOLS_VERSION}
WORKDIR /opt/kore