-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.68 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
ARG baseImage=openjdk:11
FROM ${baseImage}
ARG androidSdkBuildToolsVersion=33.0.1
ARG androidSdkDir=/opt/android
ARG androidSdkPlatformVersion=30
ARG androidSdkToolsVersion=9123335
ARG flutterSdkDir=/opt/flutter
ARG flutterSdkVersion=3.3.10
ARG workingDir=/workspace
ENV ANDROID_HOME=${androidSdkDir}
ENV FLUTTER_SDK_HOME=${flutterSdkDir}
# Download and install android SDK
RUN wget -q https://dl.google.com/android/repository/commandlinetools-linux-${androidSdkToolsVersion}_latest.zip -O android-sdk.zip
RUN unzip -qq -o android-sdk.zip -d temp && rm -f android-sdk.zip
RUN mkdir -p ${androidSdkDir}/cmdline-tools && mv temp/cmdline-tools ${androidSdkDir}/cmdline-tools/latest && rm -rf temp
# Put android SDK in path
ENV PATH="${androidSdkDir}/cmdline-tools/latest/bin:$PATH"
ENV PATH="${androidSdkDir}/cmdline-tools/tools/bin:$PATH"
ENV PATH="${androidSdkDir}/platform-tools/bin:$PATH"
ENV PATH="${androidSdkDir}/tools/bin:$PATH"
# Install required tools
RUN yes | sdkmanager "build-tools;${androidSdkBuildToolsVersion}"
RUN yes | sdkmanager "extras;android;m2repository"
RUN yes | sdkmanager "extras;google;m2repository"
RUN yes | sdkmanager "extras;google;instantapps"
RUN yes | sdkmanager "platform-tools"
RUN yes | sdkmanager "platforms;android-${androidSdkPlatformVersion}"
RUN yes | sdkmanager --licenses
# Download and install flutter SDK
RUN git clone https://github.com/flutter/flutter ${flutterSdkDir}
RUN cd ${flutterSdkDir} && git checkout ${flutterSdkVersion}
# Put flutter SDK in path
ENV PATH="${flutterSdkDir}/bin:$PATH"
# Run flutter doctor
RUN flutter doctor --android-licenses
# Cache common deps
RUN flutter precache
# Set up workspace
RUN mkdir -p ${workingDir}
WORKDIR ${workingDir}