-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
77 lines (63 loc) · 2.4 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# Created by Jugal Kishore --- 2020
#
# Android SDK
#
# Base Image: ubuntu:noble
FROM ubuntu:noble
# Setting Non-Interactive Build Time Environment Variable
ARG DEBIAN_FRONTEND=noninteractive
# Setting TERM Environment Variable
ENV TERM=xterm-256color
# Update Packages list
RUN apt-get update
# Upgrade Packages to latest
RUN apt-get upgrade --yes
# Install Packages
RUN apt-get install --yes --no-install-recommends \
git curl nano ca-certificates openjdk-21-jdk \
wget zip unzip gpg ftp tar xz-utils \
tmux screen jq tree btop openssh-client 1> /dev/null
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*
# Download Gradle
RUN mkdir /opt/gradle && \
curl -sLo gradle.zip https://services.gradle.org/distributions/gradle-8.10-all.zip && \
unzip -d /opt/gradle gradle.zip 1> /dev/null && \
rm gradle.zip
# Download Kotlin
ARG KOTLIN_VERSION=2.0.20
RUN cd /opt && \
curl -sLo kotlin.zip https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip && \
unzip kotlin.zip && \
rm kotlin.zip
# Environment Variables
ENV ANDROID_HOME /opt/android-sdk
ENV GRADLE_HOME /opt/gradle/gradle-8.10
ENV KOTLIN_HOME /opt/kotlinc
ENV PATH ${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${GRADLE_HOME}/bin:${KOTLIN_HOME}/bin
# Download Android SDK
RUN mkdir -p /opt/android-sdk/cmdline-tools && \
cd /opt/android-sdk/cmdline-tools && \
curl -sLo cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip && \
unzip cmdline-tools.zip >> /dev/null 2>&1 && \
rm cmdline-tools.zip && \
mv cmdline-tools latest
# Install Android SDK & Platform Tools
RUN yes | sdkmanager --licenses 1> /dev/null && \
yes | sdkmanager --update && \
yes | sdkmanager "platform-tools" \
"platforms;android-33" \
"platforms;android-34" \
"build-tools;33.0.3" \
"build-tools;34.0.0" 1> /dev/null
# Version Check
RUN java --version && \
kotlin -version && \
gradle --version && \
echo "SDK Manager Version: $(sdkmanager --version)"
# Git Identity Setup
RUN curl -sLO https://raw.githubusercontent.com/crazyuploader/Bash/master/git_identity.sh && \
printf "\nalias setgit=\"bash /git_identity.sh\"" >> ~/.bashrc
CMD ["bash"]