forked from capawesome-team/docker-ionic-capacitor
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
97 lines (75 loc) · 2.88 KB
/
Dockerfile
File metadata and controls
97 lines (75 loc) · 2.88 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
FROM ubuntu:24.04
# Fork of https://github.com/robingenz/docker-ionic-capacitor - thanks Robin!
LABEL MAINTAINER="Juian Scheuchenzuber <js@lvl51.de>"
ARG JAVA_VERSION=21
ARG NODEJS_VERSION=22
# See https://developer.android.com/studio/index.html#command-tools
ARG ANDROID_SDK_VERSION=11076708
# See https://developer.android.com/tools/releases/build-tools
ARG ANDROID_BUILD_TOOLS_VERSION=35.0.0
# See https://developer.android.com/studio/releases/platforms
ARG ANDROID_PLATFORMS_VERSION=35
# See https://gradle.org/releases/
ARG GRADLE_VERSION=8.11.1
# See https://www.npmjs.com/package/@ionic/cli
ARG IONIC_VERSION=7.2.0
# See https://www.npmjs.com/package/@capacitor/cli
ARG CAPACITOR_VERSION=7.0.1
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
WORKDIR /tmp
RUN apt-get update -q
# General packages
RUN apt-get install -qy \
apt-utils \
locales \
gnupg2 \
build-essential \
curl \
usbutils \
git \
unzip \
p7zip p7zip-full \
python3 \
ruby-full \
openjdk-${JAVA_VERSION}-jre \
openjdk-${JAVA_VERSION}-jdk
# Set locale
RUN locale-gen en_US.UTF-8 && update-locale
# Install Gradle
RUN mkdir -p /opt/gradle \
&& curl -fsSL https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip -o gradle.zip \
&& unzip -d /opt/gradle/ gradle.zip \
&& mv gradle.zip /opt/gradle/gradle-${GRADLE_VERSION}-all.zip
# Ensure Gradle is executable
ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION}
RUN chmod +x ${GRADLE_HOME}/bin/gradle
# Verify installation
ENV PATH=$PATH:$GRADLE_HOME/bin
RUN gradle --version
# Install Android SDK tools
ENV ANDROID_HOME=/opt/android-sdk
RUN curl -sL https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip -o commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip \
&& unzip commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip \
&& mkdir $ANDROID_HOME && mv cmdline-tools $ANDROID_HOME \
&& yes | $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses \
&& $ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platforms;android-${ANDROID_PLATFORMS_VERSION}"
ENV PATH=$PATH:${ANDROID_HOME}/cmdline-tools:${ANDROID_HOME}/platform-tools
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - \
&& apt-get update -q && apt-get install -qy nodejs
ENV NPM_CONFIG_PREFIX=${HOME}/.npm-global
ENV PATH=$PATH:${HOME}/.npm-global/bin
# Install Ionic CLI and Capacitor CLI
RUN npm install -g @ionic/cli@${IONIC_VERSION} \
&& npm install -g @capacitor/cli@${CAPACITOR_VERSION}Y
# Install gems for fastlane usage
RUN gem install rake && \
gem install bundler
# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
WORKDIR /workdir