This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
forked from valotas/flutter-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
102 lines (84 loc) · 3.71 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM openjdk:8-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
git \
lib32stdc++6 \
libglu1-mesa \
wget \
ssh \
unzip \
ca-certificates \
xz-utils \
lcov \
git-crypt \
&& rm -rf /var/lib/apt/lists/*
# RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
# Installing android base on what found at
# https://hub.docker.com/r/alvrme/alpine-android/~/dockerfile/
ENV SDK_TOOLS "3859397"
ENV BUILD_TOOLS "34.0.0"
ENV TARGET_SDK "30"
ENV ANDROID_HOME "/opt/sdk"
# Download and extract Android Tools
RUN curl -L http://dl.google.com/android/repository/sdk-tools-linux-${SDK_TOOLS}.zip -o /tmp/tools.zip --progress-bar && \
mkdir -p ${ANDROID_HOME} && \
unzip /tmp/tools.zip -d ${ANDROID_HOME} && \
rm -v /tmp/tools.zip
# Install SDK Packages
RUN mkdir -p /root/.android/ && touch /root/.android/repositories.cfg && \
yes | ${ANDROID_HOME}/tools/bin/sdkmanager "--licenses" && \
${ANDROID_HOME}/tools/bin/sdkmanager "--update" "--verbose" && \
${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;${BUILD_TOOLS}" "platform-tools" "platforms;android-${TARGET_SDK}" "extras;android;m2repository" "extras;google;google_play_services" "extras;google;m2repository"
# Install flutter
ENV FLUTTER_HOME "/opt/flutter"
ENV FLUTTER_URL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.13.1-stable.tar.xz"
RUN mkdir -p ${FLUTTER_HOME} && \
curl -L ${FLUTTER_URL} -o /tmp/flutter.tar.xz --progress-bar && \
tar xf /tmp/flutter.tar.xz -C /tmp && \
mv /tmp/flutter/ -T ${FLUTTER_HOME} && \
rm -rf /tmp/flutter.tar.xz
ENV PATH=$PATH:$FLUTTER_HOME/bin
ENV PATH=$PATH:$FLUTTER_HOME/bin/cache/dart-sdk/bin
ENV PATH=$PATH:$FLUTTER_HOME/.pub-cache/bin
RUN flutter doctor && \
chown -R root:root ${FLUTTER_HOME}
# Android NDK
ENV ANDROID_NDK_VERSION r19
ENV ANDROID_NDK_URL http://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
RUN curl -L "${ANDROID_NDK_URL}" -o android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip \
&& unzip android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip -d ${ANDROID_HOME} \
&& rm -rf android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip
ENV ANDROID_NDK_HOME ${ANDROID_HOME}/android-ndk-${ANDROID_NDK_VERSION}
ENV ANDROID_NDK_ROOT ${ANDROID_HOME}/android-ndk-${ANDROID_NDK_VERSION}
ENV PATH ${ANDROID_NDK_HOME}:$PATH
RUN chmod u+x ${ANDROID_NDK_HOME}/ -R
# Fastlane
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ruby ruby-dev build-essential \
&& rm -rf /var/lib/apt/lists/*
# fastlane depends on 0.6.0 which has a dependency bug
# https://github.com/postmodern/digest-crc/issues/19
RUN gem install digest-crc -v '0.6.1'
RUN gem install fastlane
# gsutil
RUN apt-get update && apt-get install -y gcc python-dev python-setuptools libffi-dev gnupg2 python3-pip
RUN pip install gsutil
RUN pip install --upgrade google-auth-oauthlib
# Sentry
RUN apt-get install -y npm
RUN npm config set unsafe-perm true
RUN npm install -g @sentry/cli
# Flutter test results in junit format
RUN flutter pub global activate junitreport
# AppImage & Linux App
RUN apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse cmake ninja-build clang libgtk-3-dev sudo
# Install appimagetool AppImage
RUN sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/appimagetool
# workaround AppImage issues with Docker
RUN cd /opt/; sudo chmod +x appimagetool; sed -i 's|AI\x02|\x00\x00\x00|' appimagetool; sudo ./appimagetool --appimage-extract
RUN sudo mv /opt/squashfs-root /opt/appimagetool.AppDir
RUN sudo ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
RUN pip3 install appimage-builder