├── .gitignore ├── CHANGELOG.md ├── CODEOWNERS ├── Dockerfile ├── Dockerfile-pinned ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── _tmp └── .gitkeep ├── bitrise.yml ├── docker-compose.yml ├── renovate.json └── system_report.sh /.gitignore: -------------------------------------------------------------------------------- 1 | _tmp 2 | Vagrantfile 3 | .vagrant 4 | .bitrise* 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## UPCOMING 2 | 3 | ## `v2021_09_29_1` 4 | * `Install stable version of sdkmanager` 5 | 6 | ## `v2021_09_29` 7 | * `Set Java 11 as default` 8 | 9 | ## `v2020_12_15_1` 10 | 11 | * new preinstalled package `build-tools-30.0.3` 12 | * bundletool updated to 1.4.0.jar 13 | * aapt2 updated to 4.1.1-6503028 14 | * commandline tools updated to 6858069 15 | 16 | ## `v2020_09_30_1` 17 | 18 | * Java 11 preinstalled 19 | 20 | ## `v2020_09_22_1` 21 | 22 | * new preinstalled package: `build-tools-30.0.2` 23 | * Deprecated ANDROID_HOME replaced with ANDROID_SDK_ROOT 24 | 25 | https://github.com/bitrise-docker/android/pull/318 26 | 27 | ## `v2020_06_14_1` 28 | 29 | * Deprecated SDK tools replaced with Command line Tools: https://github.com/bitrise-docker/android/pull/300 30 | 31 | ## `v2020_04_17_1` 32 | * `Gradle updated to 6.3` 33 | 34 | ## `v2020_01_30_1` 35 | 36 | * new preinstalled package: `build-tools-29.0.3` 37 | https://github.com/bitrise-docker/android/pull/279 38 | 39 | ## `v2019_10_04_1` 40 | 41 | * Add `net-tools` to pre-installed tools. 42 | https://github.com/bitrise-io/android/pull/241 43 | 44 | ## `v2019_08_11_1` 45 | 46 | * new preinstalled packages: 47 | * `firebase-tools-7.4.0`: https://github.com/bitrise-io/android/pull/256 48 | * `build-tools-29.0.2` 49 | * `build-tools-29.0.1` 50 | https://github.com/bitrise-docker/android/pull/246 51 | 52 | ## `v2019_06_21_1` 53 | 54 | * new preinstalled packages: 55 | * `platforms;android-29` 56 | * `build-tools-29.0.0` 57 | * `system-images;android-29;google_apis;x86` 58 | https://github.com/bitrise-docker/android/pull/235 59 | 60 | ## `v2018_10_05_1` 61 | 62 | * new preinstalled package: `build-tools-28.0.3`: https://github.com/bitrise-docker/android/pull/195 63 | 64 | ## `v2017_08_31_1` 65 | 66 | * new preinstalled package: `build-tools-28.0.2`: https://github.com/bitrise-docker/android/pull/188 67 | 68 | ## `v2018_07_15_1` 69 | 70 | * new preinstalled packages: 71 | * `platforms;android-28` 72 | * `build-tools-28.0.1` 73 | * `build-tools-28.0.0` 74 | * `system-images;android-28;google_apis;x86` 75 | 76 | ## `v2017_12_29_1` 77 | 78 | * new preinstalled package: `build-tools-27.0.3`: https://github.com/bitrise-docker/android/pull/148 79 | 80 | 81 | ## `v2017_12_08_1` 82 | 83 | * new preinstalled package: `build-tools-27.0.2`: https://github.com/bitrise-docker/android/pull/144 84 | 85 | ## `v2017_11_22_1` 86 | 87 | * Updated compatibility, added preinstalled x86 img 88 | * Updated LD_LIBRARY_PATH ENV 89 | 90 | ## `v2017_11_10_2` 91 | 92 | * Rollback of `system-images;android-26;google_apis;x86` package preinstall; 93 | it seems this package has a dependency on a newer `emulator`, if the package is installed the emulator 94 | package version will be bumped to `26.1.4` from `26.1.2` ... 95 | 96 | ## `v2017_11_10_1` 97 | 98 | * Rollback of `tools` package preinstall due to ARM v7 emulator boot issue. 99 | 100 | ## `v2017_11_08_2` 101 | 102 | * Rollback to the locked Emulator package version, as it was since `v2017_08_10_1`; 103 | unfortunately even the latest `emulator` package makes the related tests to fail (ARMv7 emulator fails to boot) ... 104 | 105 | ## `v2017_11_08_1` 106 | 107 | * new preinstalled packages: `build-tools-27.0.1`: https://github.com/bitrise-docker/android/pull/134 108 | 109 | ## `v2017_11_07_1` 110 | 111 | * new preinstalled packages: 112 | * `system-images;android-26;google_apis;x86` 113 | * `emulator` 114 | * `tools` 115 | * removed packages: 116 | * `platforms;android-10` 117 | * `system-images;android-21;default;armeabi-v7a` 118 | 119 | ## `v2017_10_27_1` 120 | 121 | * new preinstalled packages: `platform-27`, `build-tools-27.0.0`: https://github.com/bitrise-docker/android/pull/130 122 | * Thanks [@koral--](https://github.com/koral--) for the PR! 123 | 124 | ## `v2017_10_11_1` 125 | 126 | * fix android/sdkmanager license issues 127 | 128 | ## `v2017_10_06_1` 129 | 130 | * new preinstalled package: `build-tools-26.0.2`: https://github.com/bitrise-docker/android/pull/122 131 | 132 | ## `v2017_09_20_1` 133 | 134 | * SDK tools updated to 26.1.1 : https://github.com/bitrise-docker/android/pull/118 135 | 136 | ## `v2017_08_14_1` 137 | 138 | * Minor pre-installed package cleanup / removal: 139 | * Build tools: `26.0.0` & `25.0.2` & `20.0.0` 140 | * `platforms;android-20` 141 | * `system-images` : `android-17` & `android-15` 142 | 143 | 144 | ## `v2017_08_10_1` 145 | 146 | * Android Emulator package version locked (`26.1.2` / `4077558`) : https://github.com/bitrise-docker/android/pull/104 147 | * Docker image layer optimizations : https://github.com/bitrise-docker/android/pull/105 148 | 149 | 150 | ## `v2017_07_26_1` 151 | 152 | * new preinstalled package: `build-tools-26.0.1`: https://github.com/bitrise-docker/android/pull/100 153 | 154 | ## `v2017_07_13_1` 155 | 156 | * SDK tools, Platform Tools and Emulator versions added to `system_report.sh` : https://github.com/bitrise-docker/android/pull/96 157 | * new preinstalled package: `emulator` 158 | 159 | ## `v2017_07_12_1` 160 | 161 | * SDK tools updated to 26.0.2 : https://github.com/bitrise-docker/android/pull/95 162 | 163 | ## `v2017_06_10_1` 164 | 165 | * new preinstalled packages: `build-tools-26.0.0`, `platforms;android-26` : https://github.com/bitrise-docker/android/pull/88 166 | 167 | ## `v2017_05_10_1` 168 | 169 | * new preinstalled package: `build-tools-25.0.3`: https://github.com/bitrise-docker/android/pull/83 170 | 171 | ## `v2017_03_14_1` 172 | 173 | * SDK tools updated to 25.2.5 174 | * And related, quite significant Dockerfile revision: https://github.com/bitrise-docker/android/pull/68 175 | * Thanks [@koral--](https://github.com/koral--) for the PR! 176 | 177 | 178 | ## `v2017_01_11_1` 179 | 180 | * Pre-installed android packages cleanup: https://github.com/bitrise-docker/android/pull/55/files 181 | 182 | 183 | ## `v2017_01_05_1` 184 | 185 | * preinstall `ionic` and `cordova` npm packages (CLIs) 186 | * `QT_QPA_PLATFORM` & `LD_LIBRARY_PATH` env vars set by default, for Android Emulator 187 | 188 | 189 | ## `v2016_12_19_1` 190 | 191 | * Upgraded Android tools to `r25.2.4` 192 | * Pre-installed `libqt5widgets5` for Android Emulator 193 | 194 | 195 | ## `v2016_12_15_1` 196 | 197 | * new preinstalled package: `build-tools-25.0.2` 198 | 199 | 200 | ## `v2016_12_13_1` 201 | 202 | * package `extra-android-support` removed - it's no longer available 203 | 204 | 205 | ## `v2016_11_23_1` 206 | 207 | * new preinstalled package: `build-tools-25.0.1` 208 | 209 | 210 | ## `v2016_11_22_1` 211 | 212 | * Google Cloud SDK is now preinstalled - thanks [@bootstraponline](https://github.com/bootstraponline) for the [PR](https://github.com/bitrise-docker/android/pull/36)! 213 | 214 | 215 | ## `v2016_11_17_1` 216 | 217 | * removed `sys-img-armeabi-v7a-android-23` - it seems this Android package was removed from the registry 218 | 219 | 220 | ## `v2016_10_20_1` 221 | 222 | * new preinstalled packages: `android-25` & `build-tools-25.0.0` 223 | 224 | 225 | ## `v2016_07_21_1` 226 | 227 | * new preinstalled packages: `build-tools-24.0.1` & `sys-img-armeabi-v7a-android-24` 228 | 229 | 230 | ## `2016_06_18_1` 231 | 232 | * `android-24` is no longer preview - package names were changed 233 | 234 | 235 | ## `2016_05_29_1` 236 | 237 | * Install `Gradle` from official APT repo, instead of from a PPA 238 | * Install `Maven` from official APT repo, instead of from a PPA 239 | * Java (OpenJDK) upgrade from 7 to 8 240 | 241 | 242 | ## `2016_05_26_1` 243 | 244 | * "Checkpoint", before migration to `ubuntu:16.04` 245 | * Based on `bitriseio/docker-bitrise-base:2016_05_14_1` 246 | 247 | 248 | ## `2016_04_09_1` 249 | 250 | * `fastlane` pre-installed 251 | 252 | ## `2016_03_17_1` 253 | 254 | * Restructured `Dockerfile` (Android package install related codes), to fix 255 | Android package install license acceptance issues. 256 | * `system_report.sh` now tests whether `adb` is available, prints it's version 257 | and lists the content of `platform-tools`, to check whether the platform-tools 258 | package was installed correctly 259 | 260 | ## `2016_03_11_1` 261 | 262 | * `android-N` and `build-tools-24.0.0-preview` packages pre-installed 263 | 264 | ## `2016_01_09_1` 265 | 266 | * `build-tools-23.0.1` is now pre-installed 267 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Global match (last matching pattern takes the most precedence) 2 | * @bitrise-io/bitrise-infra-team 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/bitriseio/bitrise-base:alpha 2 | 3 | ENV ANDROID_SDK_ROOT /opt/android-sdk-linux 4 | # Preserved for backwards compatibility 5 | ENV ANDROID_HOME /opt/android-sdk-linux 6 | 7 | # ------------------------------------------------------ 8 | # --- Install required tools 9 | 10 | RUN add-apt-repository ppa:openjdk-r/ppa 11 | RUN dpkg --add-architecture i386 12 | 13 | # Base (non android specific) tools 14 | # -> should be added to bitriseio/docker-bitrise-base 15 | 16 | # Dependencies to execute Android builds 17 | RUN apt-get update -qq 18 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-8-jdk openjdk-11-jdk libc6:i386 libstdc++6:i386 libgcc1:i386 libncurses5:i386 libz1:i386 net-tools 19 | 20 | # Keystore format has changed since JAVA 8 https://bugs.launchpad.net/ubuntu/+source/openjdk-9/+bug/1743139 21 | RUN mv /etc/ssl/certs/java/cacerts /etc/ssl/certs/java/cacerts.old \ 22 | && keytool -importkeystore -destkeystore /etc/ssl/certs/java/cacerts -deststoretype jks -deststorepass changeit -srckeystore /etc/ssl/certs/java/cacerts.old -srcstoretype pkcs12 -srcstorepass changeit \ 23 | && rm /etc/ssl/certs/java/cacerts.old 24 | 25 | # Select JAVA 11 as default 26 | RUN sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac 27 | RUN sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 28 | 29 | # ------------------------------------------------------ 30 | # --- Download Android Command line Tools into $ANDROID_SDK_ROOT 31 | 32 | RUN cd /opt \ 33 | && wget -q https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -O android-commandline-tools.zip \ 34 | && mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools \ 35 | && unzip -q android-commandline-tools.zip -d /tmp/ \ 36 | && mv /tmp/cmdline-tools/ ${ANDROID_SDK_ROOT}/cmdline-tools/latest \ 37 | && rm android-commandline-tools.zip && ls -la ${ANDROID_SDK_ROOT}/cmdline-tools/latest/ 38 | 39 | ENV PATH ${PATH}:${ANDROID_SDK_ROOT}/platform-tools:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin 40 | 41 | # ------------------------------------------------------ 42 | # --- Install Android SDKs and other build packages 43 | 44 | # Other tools and resources of Android SDK 45 | # you should only install the packages you need! 46 | # To get a full list of available options you can use: 47 | # sdkmanager --list 48 | 49 | # Accept licenses before installing components, no need to echo y for each component 50 | # License is valid for all the standard components in versions installed from this file 51 | # Non-standard components: MIPS system images, preview versions, GDK (Google Glass) and Android Google TV require separate licenses, not accepted there 52 | RUN yes | sdkmanager --licenses 53 | 54 | RUN touch /root/.android/repositories.cfg 55 | 56 | # Emulator and Platform tools 57 | RUN yes | sdkmanager "emulator" "platform-tools" 58 | 59 | # SDKs 60 | # Please keep these in descending order! 61 | # The `yes` is for accepting all non-standard tool licenses. 62 | 63 | RUN yes | sdkmanager --update --channel=0 64 | # Please keep all sections in descending order! 65 | RUN yes | sdkmanager \ 66 | "platforms;android-30" \ 67 | "platforms;android-29" \ 68 | "platforms;android-28" \ 69 | "platforms;android-27" \ 70 | "platforms;android-26" \ 71 | "platforms;android-25" \ 72 | "platforms;android-24" \ 73 | "platforms;android-23" \ 74 | "platforms;android-22" \ 75 | "platforms;android-21" \ 76 | "platforms;android-19" \ 77 | "platforms;android-17" \ 78 | "platforms;android-15" \ 79 | "build-tools;30.0.3" \ 80 | "build-tools;30.0.2" \ 81 | "build-tools;30.0.0" \ 82 | "build-tools;29.0.3" \ 83 | "build-tools;29.0.2" \ 84 | "build-tools;29.0.1" \ 85 | "build-tools;29.0.0" \ 86 | "build-tools;28.0.3" \ 87 | "build-tools;28.0.2" \ 88 | "build-tools;28.0.1" \ 89 | "build-tools;28.0.0" \ 90 | "build-tools;27.0.3" \ 91 | "build-tools;27.0.2" \ 92 | "build-tools;27.0.1" \ 93 | "build-tools;27.0.0" \ 94 | "build-tools;26.0.2" \ 95 | "build-tools;26.0.1" \ 96 | "build-tools;25.0.3" \ 97 | "build-tools;24.0.3" \ 98 | "build-tools;23.0.3" \ 99 | "build-tools;22.0.1" \ 100 | "build-tools;21.1.2" \ 101 | "build-tools;19.1.0" \ 102 | "build-tools;17.0.0" \ 103 | "system-images;android-30;google_apis;x86" \ 104 | "system-images;android-29;google_apis;x86" \ 105 | "system-images;android-28;google_apis;x86_64" \ 106 | "system-images;android-26;google_apis;x86" \ 107 | "system-images;android-25;google_apis;armeabi-v7a" \ 108 | "system-images;android-24;default;armeabi-v7a" \ 109 | "system-images;android-22;default;armeabi-v7a" \ 110 | "system-images;android-19;default;armeabi-v7a" \ 111 | "extras;android;m2repository" \ 112 | "extras;google;m2repository" \ 113 | "extras;google;google_play_services" \ 114 | "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \ 115 | "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" \ 116 | "add-ons;addon-google_apis-google-23" \ 117 | "add-ons;addon-google_apis-google-22" \ 118 | "add-ons;addon-google_apis-google-21" 119 | 120 | # ------------------------------------------------------ 121 | # --- Install Gradle from PPA 122 | 123 | # Gradle PPA 124 | ENV GRADLE_VERSION=6.3 125 | ENV PATH=$PATH:"/opt/gradle/gradle-6.3/bin/" 126 | RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp \ 127 | && unzip -d /opt/gradle /tmp/gradle-*.zip \ 128 | && chmod +775 /opt/gradle \ 129 | && gradle --version \ 130 | && rm -rf /tmp/gradle* 131 | 132 | # ------------------------------------------------------ 133 | # --- Install Maven 3 from PPA 134 | 135 | RUN apt-get purge maven maven2 \ 136 | && apt-get update \ 137 | && apt-get -y install maven \ 138 | && mvn --version 139 | 140 | ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64 141 | 142 | # ------------------------------------------------------ 143 | # --- Pre-install Ionic and Cordova CLIs 144 | 145 | RUN npm install -g ionic cordova appcenter-cli 146 | 147 | 148 | # ------------------------------------------------------ 149 | # --- Install Fastlane 150 | 151 | RUN gem install fastlane --no-document \ 152 | && fastlane --version 153 | 154 | # ------------------------------------------------------ 155 | # --- Install Google Cloud SDK 156 | # https://cloud.google.com/sdk/downloads 157 | # Section: apt-get (Debian and Ubuntu only) 158 | # 159 | # E.g. for "Using Firebase Test Lab for Android from the gcloud Command Line": 160 | # https://firebase.google.com/docs/test-lab/command-line 161 | # 162 | 163 | RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk-`lsb_release -c -s` main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list 164 | RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - 165 | RUN sudo apt-get update -qq \ 166 | && sudo apt-get install -y -qq google-cloud-sdk 167 | 168 | ENV GCLOUD_SDK_CONFIG /usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json 169 | 170 | # gcloud config doesn't update config.json. See the official Dockerfile for details: 171 | # https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/Dockerfile 172 | RUN /usr/bin/gcloud config set --installation component_manager/disable_update_check true \ 173 | && sed -i -- 's/\"disable_updater\": false/\"disable_updater\": true/g' $GCLOUD_SDK_CONFIG \ 174 | && /usr/bin/gcloud config set --installation core/disable_usage_reporting true \ 175 | && sed -i -- 's/\"disable_usage_reporting\": false/\"disable_usage_reporting\": true/g' $GCLOUD_SDK_CONFIG 176 | 177 | # ------------------------------------------------------ 178 | # --- Install Firebase Tools (Firebase CLI) 179 | # https://github.com/firebase/firebase-tools 180 | # 181 | # It's required for using Firebase App Distribution. 182 | # https://firebase.google.com/products/app-distribution 183 | # 184 | 185 | RUN npm install -g firebase-tools 186 | 187 | # ------------------------------------------------------ 188 | # --- Install additional packages 189 | 190 | # Required for Android ARM Emulator 191 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libqt5widgets5 192 | ENV QT_QPA_PLATFORM offscreen 193 | ENV LD_LIBRARY_PATH ${ANDROID_SDK_ROOT}/emulator/lib64:${ANDROID_SDK_ROOT}/emulator/lib64/qt/lib 194 | 195 | # ------------------------------------------------------- 196 | # Tools to parse apk/aab info in deploy-to-bitrise-io step 197 | ENV APKINFO_TOOLS /opt/apktools 198 | RUN mkdir ${APKINFO_TOOLS} 199 | RUN wget -q https://github.com/google/bundletool/releases/download/1.4.0/bundletool-all-1.4.0.jar -O ${APKINFO_TOOLS}/bundletool.jar 200 | RUN cd /opt \ 201 | && wget -q https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.1.1-6503028/aapt2-4.1.1-6503028-linux.jar -O aapt2.jar \ 202 | && unzip -q aapt2.jar aapt2 -d ${APKINFO_TOOLS} \ 203 | && rm aapt2.jar 204 | 205 | # ------------------------------------------------------ 206 | # --- Cleanup and rev num 207 | 208 | # Cleaning 209 | RUN apt-get clean 210 | 211 | ENV BITRISE_DOCKER_REV_NUMBER_ANDROID v2021_09_29_1 212 | CMD bitrise -version 213 | -------------------------------------------------------------------------------- /Dockerfile-pinned: -------------------------------------------------------------------------------- 1 | # Once an "Alpha" is properly tested and declared as production ready, a "pinned" version is created 2 | # and published. Pinned versions are considered production ready, and the "latest" pinned version 3 | # is pre-cached on https://www.bitrise.io/ Linux/Android Virtual Machines. 4 | # Read more about how versions are handled in the README.md 5 | 6 | FROM quay.io/bitriseio/android:alpha-v2021_09_29-11_30-b2568 7 | 8 | CMD bitrise --version 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Bitrise 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Pull Request Checklist 2 | 3 | Check/accept these: 4 | 5 | - [ ] The tool I added is stable, and __does not require frequent updates__. _Preinstalled tools on the LTS stacks 6 | are not updated, so if the tool requires frequent updates you should handle the installation on-demand (see: [Install Any Additional Tool - DevCenter](https://bitrise-io.github.io/devcenter/tips-and-tricks/install-additional-tools/) for more information)_ 7 | - [ ] I've updated the version in the Dockerfile 8 | - [ ] I've updated the CHANGELOG.md 9 | - [ ] I've provided a link or explanation below which describes the changes in the tool itself 10 | - [ ] I added a version report line to [`system_report.sh`](/system_report.sh) for the new tool(s) I added 11 | 12 | `Copy or link the tool's changelog here` 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-android 2 | 3 | Android Docker image, based on the Bitrise Base Docker 4 | image ( https://github.com/bitrise-docker/android / `bitriseio/docker-bitrise-base` ), 5 | and extends it with pre-installed Android SDK tools/setup. 6 | 7 | This docker image is pre-cached on the related [bitrise.io](https://www.bitrise.io) 8 | Virtual Machines. 9 | 10 | **If you'd like to add a tool** to be pre-installed you can create a 11 | Pull Request, adding your changes to the `Dockerfile` of this repository. 12 | *Please also add* a related test/report to the `system_report.sh` file, 13 | which is used to test & list the pre-installed tools. 14 | 15 | When a new version of this stack is available on [bitrise.io](https://www.bitrise.io) 16 | we'll run `system_report.sh` and post the result into 17 | the [bitrise.io GitHub repository](https://github.com/bitrise-io/bitrise.io), under the `system_reports` folder. The `system_report.sh` script can be run with `docker-compose` locally too, 18 | with: `docker-compose run --rm app bash system_report.sh`. 19 | 20 | [Request a feature](https://discuss.bitrise.io/c/feature-request) 21 | 22 | [Report an issue](https://discuss.bitrise.io/c/issues/other-issues) 23 | 24 | ## docker-compose template 25 | 26 | A `docker-compose.yml` is also included, configured for quick testing. 27 | 28 | To build the image with `docker-compose` all you have to do is: `docker-compose build` 29 | 30 | Then to run `bitrise --version` in the container: `docker-compose run --rm app bitrise --version` 31 | 32 | To log into an interactive `bash` shell **inside** the container just run: `docker-compose run --rm app /bin/bash` - when you want to exit just run `exit` inside the container. 33 | 34 | For convenience / experimenting the `./_tmp` folder (which is in `.gitignore`) 35 | will be shared to `/bitrise/tmp`, to make it easy for you to share files 36 | with the container. 37 | 38 | Every time you change your `Dockerfile` you'll have to run `docker-compose build` again, 39 | so your next `docker-compose run` will run in the environment you specify in 40 | the `Dockerfile`. 41 | -------------------------------------------------------------------------------- /_tmp/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitrise-io/android/85a1df46facd8ebd20189a7abf7090ce3ca40ce7/_tmp/.gitkeep -------------------------------------------------------------------------------- /bitrise.yml: -------------------------------------------------------------------------------- 1 | --- 2 | format_version: 1.1.0 3 | default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git 4 | app: 5 | envs: 6 | - DOCKERHUB_IMG_ID_ALPHA: bitriseio/docker-android-alpha 7 | - DOCKERHUB_IMG_ID_PINNED: bitriseio/docker-android 8 | - DOCKER_FILE_PATH_ALPHA: ./Dockerfile 9 | - DOCKER_FILE_PATH_PINNED: ./Dockerfile-pinned 10 | # 11 | - DOCKERHUB_IMG_ID: $DOCKERHUB_IMG_ID_ALPHA 12 | - DOCKER_FILE_PATH: $DOCKER_FILE_PATH_ALPHA 13 | # define in .bitrise.secrets.yml 14 | - DOCKER_LOGIN_USER: $DOCKER_LOGIN_USER 15 | - DOCKER_LOGIN_PASS: $DOCKER_LOGIN_PASS 16 | # on CI 17 | - SLACK_WEBHOOK_URL: $SLACK_WEBHOOK_URL 18 | - SLACK_CHANNEL: $SLACK_CHANNEL 19 | # Quay 20 | - QUAY_IMG_ID: quay.io/bitriseio/android 21 | - QUAY_LOGIN_USER: $QUAY_LOGIN_USER 22 | - QUAY_LOGIN_PASS: $QUAY_LOGIN_PASS 23 | - IS_ALPHA: "true" 24 | # optional 25 | - CONFIG_do_not_deploy_latest_tag: $CONFIG_do_not_deploy_latest_tag 26 | 27 | workflows: 28 | 29 | # 30 | # Main workflows 31 | # 32 | 33 | # -- Rebuild / test 34 | 35 | rebuild-pinned: 36 | before_run: 37 | - _pinned_envs 38 | after_run: 39 | - _rebuild 40 | 41 | rebuild-alpha: 42 | before_run: 43 | - _alpha_envs 44 | after_run: 45 | - _rebuild 46 | 47 | # -- Deploy 48 | 49 | deploy-pinned: 50 | before_run: 51 | - _pinned_envs 52 | after_run: 53 | - _deploy 54 | 55 | deploy-alpha: 56 | before_run: 57 | - _alpha_envs 58 | after_run: 59 | - _deploy 60 | 61 | # 62 | # Utility workflows 63 | # 64 | 65 | _rebuild: 66 | steps: 67 | - script@1.1.0: 68 | title: docker prune previous image versions 69 | inputs: 70 | - content: | 71 | #!/usr/bin/env bash 72 | set -ex 73 | 74 | # Docker filter does not match slashes (on a purpose) 75 | # https://github.com/moby/moby/issues/36196 76 | # Therefore, grep / awk magic will be used here 77 | # The following will capture both android and android-ndk[-lts] images 78 | docker rmi -f $(docker images | grep -E 'bitriseio/android' | awk '{print $1 ":" $2}') 79 | - script@1.1.0: 80 | title: docker infos & images 81 | inputs: 82 | - content: | 83 | #!/bin/bash 84 | set -ex 85 | 86 | docker images 87 | df -kh ./ 88 | docker info 89 | - script@1.1.0: 90 | title: docker build 91 | inputs: 92 | - content: | 93 | #!/bin/bash 94 | set -ex 95 | 96 | docker build --pull --no-cache -t "${DOCKERHUB_IMG_ID}:latest" --file "${DOCKER_FILE_PATH}" . 97 | 98 | docker images 99 | 100 | _pinned_envs: 101 | envs: 102 | - DOCKERHUB_IMG_ID: $DOCKERHUB_IMG_ID_PINNED 103 | - DOCKER_FILE_PATH: $DOCKER_FILE_PATH_PINNED 104 | - IS_ALPHA: "false" 105 | _alpha_envs: 106 | envs: 107 | - DOCKERHUB_IMG_ID: $DOCKERHUB_IMG_ID_ALPHA 108 | - DOCKER_FILE_PATH: $DOCKER_FILE_PATH_ALPHA 109 | - IS_ALPHA: "true" 110 | 111 | _generate_image_deploy_tag: 112 | steps: 113 | - script: 114 | inputs: 115 | - content: | 116 | #!/bin/bash 117 | set -ex 118 | envman add --key 'DOCKER_IMAGE_DEPLOY_TAG' --value "v$(date +%Y_%m_%d-%H_%M)-b${BITRISE_BUILD_NUMBER}" 119 | 120 | _deploy: 121 | before_run: 122 | - _generate_image_deploy_tag 123 | - _rebuild 124 | steps: 125 | - script@1.1.0: 126 | title: docker login 127 | inputs: 128 | - content: | 129 | #!/bin/bash 130 | set -e 131 | echo "=> Docker login..." 132 | docker login -u "${DOCKER_LOGIN_USER}" -p "${DOCKER_LOGIN_PASS}" 133 | echo "=> Quay.io login..." 134 | docker login -u "${QUAY_LOGIN_USER}" -p "${QUAY_LOGIN_PASS}" quay.io 135 | - script@1.1.0: 136 | title: docker push 137 | inputs: 138 | - content: | 139 | #!/bin/bash 140 | set -ex 141 | 142 | if [ -z "${DOCKER_IMAGE_DEPLOY_TAG}" ] ; then 143 | echo " [!] No DOCKER_IMAGE_DEPLOY_TAG specified!" 144 | exit 1 145 | fi 146 | 147 | ### Tags 148 | # Docker Hub 149 | docker tag "${DOCKERHUB_IMG_ID}:latest" "${DOCKERHUB_IMG_ID}:${DOCKER_IMAGE_DEPLOY_TAG}" 150 | 151 | # Quay.io 152 | if [[ "${IS_ALPHA}" == "true" ]]; then 153 | image_tag="alpha-${DOCKER_IMAGE_DEPLOY_TAG}" 154 | latest_image_tag="alpha" 155 | else 156 | image_tag="${DOCKER_IMAGE_DEPLOY_TAG}" 157 | latest_image_tag="latest" 158 | fi 159 | docker tag "${DOCKERHUB_IMG_ID}:latest" "${QUAY_IMG_ID}:${image_tag}" 160 | docker tag "${DOCKERHUB_IMG_ID}:latest" "${QUAY_IMG_ID}:${latest_image_tag}" 161 | 162 | ### Push 163 | # Docker Hub 164 | docker push "${DOCKERHUB_IMG_ID}:${DOCKER_IMAGE_DEPLOY_TAG}" 165 | docker push "${DOCKERHUB_IMG_ID}:latest" 166 | 167 | # Quay.io 168 | docker push "${QUAY_IMG_ID}:${image_tag}" 169 | docker push "${QUAY_IMG_ID}:${latest_image_tag}" 170 | - slack@2.1.0: 171 | run_if: '{{.IsCI | and .IsBuildFailed}}' 172 | inputs: 173 | - webhook_url: $SLACK_WEBHOOK_URL 174 | - channel: $SLACK_CHANNEL 175 | - from_username: "$BITRISE_APP_TITLE - OK" 176 | - from_username_on_error: "$BITRISE_APP_TITLE - ERROR" 177 | - message: | 178 | Finished: 179 | 180 | - Branch: *$BITRISE_GIT_BRANCH* 181 | - Tag: $BITRISE_GIT_TAG 182 | - Image ID: $DOCKERHUB_IMG_ID 183 | - Image tag: $DOCKER_IMAGE_DEPLOY_TAG 184 | - Build URL: $BITRISE_BUILD_URL 185 | - Build Number: $BITRISE_BUILD_NUMBER 186 | - Build Message: $BITRISE_GIT_MESSAGE 187 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | app: 2 | build: . 3 | command: bitrise --version 4 | volumes: 5 | - ./_tmp:/bitrise/tmp 6 | - ./system_report.sh:/bitrise/src/system_report.sh 7 | environment: 8 | # => if you want your code to be git-cloned inside the container 9 | CI: "true" 10 | BITRISE_SOURCE_DIR: /bitrise/src 11 | # => if you put your code into the _tmp folder 12 | # CI: "false" 13 | # BITRISE_SOURCE_DIR: /bitrise/tmp 14 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "local>bitrise-io/renovate-config" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /system_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo 5 | echo '#' 6 | echo '# This System Report was generated by: https://github.com/bitrise-docker/android/blob/master/system_report.sh' 7 | echo '# Pull Requests are welcome!' 8 | echo '#' 9 | echo 10 | 11 | echo 12 | echo "=== Revision / ID ======================" 13 | echo "* BITRISE_DOCKER_REV_NUMBER_ANDROID: $BITRISE_DOCKER_REV_NUMBER_ANDROID" 14 | echo "========================================" 15 | echo 16 | 17 | # Make sure that the reported version is only 18 | # a single line! 19 | echo 20 | echo "=== Pre-installed tool versions ========" 21 | 22 | ver_line="$(gradle --version | grep 'Gradle ')" ; echo "* Gradle: $ver_line" 23 | ver_line="$(mvn --version | grep 'Apache Maven')" ; echo "* Maven: $ver_line" 24 | ver_line="$( javac -version 2>&1 )" ; echo "* Java: $ver_line" 25 | 26 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 27 | echo " (!) Cordova & Ionic are not preinstalled on this Stack / in this image" 28 | else 29 | ver_line="$(cordova --version)" ; echo "* Cordova CLI version: $ver_line" 30 | ver_line="$(ionic --version)" ; echo "* Ionic CLI version: $ver_line" 31 | ver_line="$(appcenter --version | awk '{print $3}')" ; echo "* Appcenter-CLI version: $ver_line" 32 | fi 33 | 34 | echo "========================================" 35 | echo 36 | 37 | echo "=== Java ===============================" 38 | 39 | echo "* JAVA_HOME: $JAVA_HOME" 40 | ver_line="$( java -version 2>&1 | head -n 1)" ; echo "* Java: $ver_line" 41 | ver_line="$( javac -version 2>&1 | head -n 1)" ; echo "* Javac: $ver_line" 42 | 43 | echo "========================================" 44 | echo 45 | 46 | echo 47 | echo "=== Google Cloud SDK components ========" 48 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 49 | echo " (!) Not pre-installed on this Stack / in this image" 50 | else 51 | gcloud version 52 | fi 53 | echo "========================================" 54 | echo 55 | 56 | echo 57 | echo "=== Firebase Tools components ==========" 58 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 59 | echo " (!) Not pre-installed on this Stack / in this image" 60 | else 61 | firebase --version 62 | fi 63 | echo "========================================" 64 | echo 65 | 66 | echo 67 | echo "=== Google Cloud Network Check =========" 68 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 69 | echo " (!) Not pre-installed on this Stack / in this image" 70 | else 71 | gcloud info --run-diagnostics 72 | fi 73 | echo "========================================" 74 | echo 75 | 76 | echo 77 | echo "=== Testing Android tools ==============" 78 | echo " * adb path:" 79 | which adb 80 | echo 81 | echo " * adb version:" 82 | adb version 83 | echo 84 | echo " * SDK packages:" 85 | if [[ ! -z "${BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS}" ]] ; then 86 | echo " (!) Version check not available on this Stack / in this image" 87 | else 88 | grep ^Pkg.Revision ${ANDROID_HOME}/cmdline-tools//tools/source.properties | cut -d= -f 2 | xargs -I {} echo "* Command line Tools version: {}" 89 | grep ^Pkg.Revision ${ANDROID_HOME}/platform-tools/source.properties | cut -d= -f 2 | xargs -I {} echo "* Platform Tools version: {}" 90 | grep ^Pkg.Revision ${ANDROID_HOME}/emulator/source.properties | cut -d= -f 2 | xargs -I {} echo "* Emulator version: {}" 91 | fi 92 | 93 | echo "========================================" 94 | echo 95 | 96 | echo 97 | echo "=== Android tools/dirs =================" 98 | echo 99 | echo "* ANDROID_HOME:" 100 | ls -a1 ${ANDROID_HOME} 101 | echo 102 | echo "* ./platform-tools:" 103 | ls -1 ${ANDROID_HOME}/platform-tools 104 | echo 105 | echo "* ./build-tools:" 106 | ls -1 ${ANDROID_HOME}/build-tools 107 | echo 108 | echo "* ./emulator:" 109 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 110 | echo " (!) ./emulator dir does not exist on LTS" 111 | else 112 | ls -1 ${ANDROID_HOME}/emulator 113 | fi 114 | echo 115 | echo "* ./extras:" 116 | tree -L 2 ${ANDROID_HOME}/extras 117 | echo 118 | echo "* ./platforms:" 119 | ls -1 ${ANDROID_HOME}/platforms 120 | echo 121 | echo "* ./system-images:" 122 | tree -L 3 ${ANDROID_HOME}/system-images 123 | echo "========================================" 124 | echo 125 | 126 | echo 127 | echo "=== Android APK tools ==================" 128 | echo 129 | echo "* aapt2:" 130 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 131 | echo " (!) Not pre-installed on this Stack / in this image" 132 | else 133 | /opt/apktools/aapt2 version 134 | fi 135 | echo 136 | echo "* bundletool:" 137 | if [[ ! -z "$BITRISE_DOCKER_REV_NUMBER_ANDROID_NDK_LTS" ]] ; then 138 | echo " (!) Not pre-installed on this Stack / in this image" 139 | else 140 | java -jar /opt/apktools/bundletool.jar version 141 | fi 142 | echo 143 | echo "========================================" 144 | echo 145 | --------------------------------------------------------------------------------